Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for LevelDebug (0.19 sec)

  1. src/log/slog/level_test.go

    		{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"},
    		{LevelDebug - 2, "DEBUG-2"},
    	} {
    		got := test.in.String()
    		if got != test.want {
    			t.Errorf("%d: got %s, want %s", test.in, got, test.want)
    		}
    	}
    }
    
    func TestLevelVar(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 20:44:14 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. src/log/slog/logger.go

    	l.logAttrs(ctx, level, msg, attrs...)
    }
    
    // Debug logs at [LevelDebug].
    func (l *Logger) Debug(msg string, args ...any) {
    	l.log(context.Background(), LevelDebug, msg, args...)
    }
    
    // DebugContext logs at [LevelDebug] with the given context.
    func (l *Logger) DebugContext(ctx context.Context, msg string, args ...any) {
    	l.log(ctx, LevelDebug, msg, args...)
    }
    
    // Info logs at [LevelInfo].
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 08 18:26:18 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  3. src/log/slog/example_custom_levels_test.go

    // the standard log levels and the custom log levels.
    func ExampleHandlerOptions_customLevels() {
    	// Exported constants from a custom logging package.
    	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)
    	)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 3K bytes
    - Viewed (0)
  4. tools/bug-report/pkg/processlog/processlog.go

    	"istio.io/istio/tools/bug-report/pkg/config"
    	"istio.io/istio/tools/bug-report/pkg/util/match"
    )
    
    const (
    	levelFatal = "fatal"
    	levelError = "error"
    	levelWarn  = "warn"
    	levelInfo  = "info"
    	levelDebug = "debug"
    	levelTrace = "trace"
    )
    
    var ztunnelLogPattern = regexp.MustCompile(`^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z)\s+(?:\w+\s+)?(\w+)\s+([\w\.:]+)(.*)`)
    
    // Stats represents log statistics.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 19 21:44:33 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  5. src/log/slog/example_log_level_test.go

    	log.Print("log debug") // log debug
    	slog.Debug("debug")    // no output
    	slog.Info("info")      // INFO info
    
    	// Set the default logging level to slog.LevelDebug.
    	currentLogLevel := slog.SetLogLoggerLevel(slog.LevelDebug)
    	defer slog.SetLogLoggerLevel(currentLogLevel) // revert changes after the example
    
    	log.Print("log debug") // log debug
    	slog.Debug("debug")    // DEBUG debug
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 10 21:25:30 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  6. src/log/slog/level.go

    // Level range. OpenTelemetry also has the names TRACE and FATAL, which slog
    // does not. But those OpenTelemetry levels can still be represented as slog
    // Levels by using the appropriate integers.
    const (
    	LevelDebug Level = -4
    	LevelInfo  Level = 0
    	LevelWarn  Level = 4
    	LevelError Level = 8
    )
    
    // String returns a name for the level.
    // If the level has a name, then that name
    // in uppercase is returned.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 30 17:34:43 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  7. src/log/slog/logger_test.go

    	var logBuf bytes.Buffer
    	log.SetOutput(&logBuf)
    	log.SetFlags(0)
    
    	for _, test := range []struct {
    		logLevel Level
    		logFn    func(string, ...any)
    		want     string
    	}{
    		{LevelDebug, Debug, "DEBUG a"},
    		{LevelDebug, Info, "INFO a"},
    		{LevelInfo, Debug, ""},
    		{LevelInfo, Info, "INFO a"},
    	} {
    		SetLogLoggerLevel(test.logLevel)
    		test.logFn("a")
    		checkLogOutput(t, logBuf.String(), test.want)
    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. src/log/slog/example_level_handler_test.go

    // existing Handler while preserving its other behavior.
    //
    // This example demonstrates increasing the log level to reduce a logger's
    // output.
    //
    // Another typical use would be to decrease the log level (to LevelDebug, say)
    // during a part of the program that was suspected of containing a bug.
    func ExampleHandler_levelHandler() {
    	th := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{ReplaceAttr: slogtest.RemoveTime})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  9. src/log/slog/value_test.go

    	}
    	_ = u
    	_ = f
    	_ = b
    	_ = s
    	_ = x
    	_ = tm
    }
    
    func TestAnyLevelAlloc(t *testing.T) {
    	// Because typical Levels are small integers,
    	// they are zero-alloc.
    	var a Value
    	x := LevelDebug + 100
    	wantAllocs(t, 0, func() { a = AnyValue(x) })
    	_ = a
    }
    
    func TestAnyValue(t *testing.T) {
    	for _, test := range []struct {
    		in   any
    		want Value
    	}{
    		{1, IntValue(1)},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  10. src/log/slog/handler_test.go

    	for _, test := range []struct {
    		leveler Leveler
    		want    bool
    	}{
    		{nil, true},
    		{LevelWarn, false},
    		{&LevelVar{}, true}, // defaults to Info
    		{levelVar(LevelWarn), false},
    		{LevelDebug, true},
    		{levelVar(LevelDebug), true},
    	} {
    		h := &commonHandler{opts: HandlerOptions{Level: test.leveler}}
    		got := h.enabled(LevelInfo)
    		if got != test.want {
    			t.Errorf("%v: got %t, want %t", test.leveler, got, test.want)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 02 13:57:53 UTC 2023
    - 19.6K bytes
    - Viewed (0)
Back to top