Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for LevelError (0.63 sec)

  1. src/log/slog/level_test.go

    	"bytes"
    	"flag"
    	"strings"
    	"testing"
    )
    
    func TestLevelString(t *testing.T) {
    	for _, test := range []struct {
    		in   Level
    		want string
    	}{
    		{0, "INFO"},
    		{LevelError, "ERROR"},
    		{LevelError + 2, "ERROR+2"},
    		{LevelError - 2, "WARN+2"},
    		{LevelWarn, "WARN"},
    		{LevelWarn - 1, "INFO+3"},
    		{LevelInfo, "INFO"},
    		{LevelInfo + 1, "INFO+1"},
    		{LevelInfo - 3, "DEBUG+1"},
    		{LevelDebug, "DEBUG"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 20:44:14 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. tools/bug-report/pkg/processlog/processlog.go

    		_, level, text, valid := parseLog(l)
    		if !valid {
    			continue
    		}
    		switch level {
    		case levelFatal, levelError, levelWarn:
    			if match.MatchesGlobs(text, config.IgnoredErrors) {
    				continue
    			}
    			switch level {
    			case levelFatal:
    				out.numFatals++
    			case levelError:
    				out.numErrors++
    			case levelWarn:
    				out.numWarnings++
    			}
    		default:
    		}
    	}
    	return out
    }
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 19 21:44:33 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  3. src/log/slog/level.go

    	}
    
    	switch {
    	case l < LevelInfo:
    		return str("DEBUG", l-LevelDebug)
    	case l < LevelWarn:
    		return str("INFO", l-LevelInfo)
    	case l < LevelError:
    		return str("WARN", l-LevelWarn)
    	default:
    		return str("ERROR", l-LevelError)
    	}
    }
    
    // MarshalJSON implements [encoding/json.Marshaler]
    // by quoting the output of [Level.String].
    func (l Level) MarshalJSON() ([]byte, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 30 17:34:43 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  4. src/log/slog/example_log_level_test.go

    // of the internal writer that uses the custom handler for log package after
    // calling slog.SetDefault.
    func ExampleSetLogLoggerLevel_slog() {
    	// Set the default logging level to slog.LevelError.
    	currentLogLevel := slog.SetLogLoggerLevel(slog.LevelError)
    	defer slog.SetLogLoggerLevel(currentLogLevel) // revert changes after the example
    
    	defer slog.SetDefault(slog.Default()) // revert changes after the example
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 10 21:25:30 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  5. src/log/slog/example_custom_levels_test.go

    	const (
    		LevelTrace     = slog.Level(-8)
    		LevelDebug     = slog.LevelDebug
    		LevelInfo      = slog.LevelInfo
    		LevelNotice    = slog.Level(2)
    		LevelWarning   = slog.LevelWarn
    		LevelError     = slog.LevelError
    		LevelEmergency = slog.Level(12)
    	)
    
    	th := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
    		// Set a custom level to show all log output. The default value is
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 3K bytes
    - Viewed (0)
  6. src/log/slog/logger.go

    	l.log(ctx, LevelWarn, msg, args...)
    }
    
    // Error logs at [LevelError].
    func (l *Logger) Error(msg string, args ...any) {
    	l.log(context.Background(), LevelError, msg, args...)
    }
    
    // ErrorContext logs at [LevelError] with the given context.
    func (l *Logger) ErrorContext(ctx context.Context, msg string, args ...any) {
    	l.log(ctx, LevelError, msg, args...)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 08 18:26:18 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  7. src/log/slog/logger_test.go

    		wantLevel Level
    	}{
    		{l.DebugContext, LevelDebug},
    		{l.InfoContext, LevelInfo},
    		{l.WarnContext, LevelWarn},
    		{l.ErrorContext, LevelError},
    		{DebugContext, LevelDebug},
    		{InfoContext, LevelInfo},
    		{WarnContext, LevelWarn},
    		{ErrorContext, LevelError},
    	} {
    		h.clear()
    		ctx := context.WithValue(context.Background(), "L", test.wantLevel)
    
    		test.f(ctx, "msg")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 10 21:25:30 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  8. api/go1.21.txt

    pkg log/slog, const KindUint64 = 7 #56345
    pkg log/slog, const KindUint64 Kind #56345
    pkg log/slog, const LevelDebug = -4 #56345
    pkg log/slog, const LevelDebug Level #56345
    pkg log/slog, const LevelError = 8 #56345
    pkg log/slog, const LevelError Level #56345
    pkg log/slog, const LevelInfo = 0 #56345
    pkg log/slog, const LevelInfo Level #56345
    pkg log/slog, const LevelKey ideal-string #56345
    pkg log/slog, const LevelKey = "level" #56345
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 09:39:17 UTC 2023
    - 25.6K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"KindInt64", Const, 21},
    		{"KindLogValuer", Const, 21},
    		{"KindString", Const, 21},
    		{"KindTime", Const, 21},
    		{"KindUint64", Const, 21},
    		{"Level", Type, 21},
    		{"LevelDebug", Const, 21},
    		{"LevelError", Const, 21},
    		{"LevelInfo", Const, 21},
    		{"LevelKey", Const, 21},
    		{"LevelVar", Type, 21},
    		{"LevelWarn", Const, 21},
    		{"Leveler", Type, 21},
    		{"Log", Func, 21},
    		{"LogAttrs", Func, 21},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top