Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for LevelVar (0.26 sec)

  1. src/log/slog/level_test.go

    	}
    	if g, w := lf, LevelWarn+3; g != w {
    		t.Errorf("got %v, want %v", g, w)
    	}
    }
    
    func TestLevelVarMarshalText(t *testing.T) {
    	var v LevelVar
    	v.Set(LevelWarn)
    	data, err := v.MarshalText()
    	if err != nil {
    		t.Fatal(err)
    	}
    	var v2 LevelVar
    	if err := v2.UnmarshalText(data); err != nil {
    		t.Fatal(err)
    	}
    	if g, w := v2.Level(), LevelWarn; g != w {
    		t.Errorf("got %s, want %s", g, w)
    	}
    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/doc.go

    fixes the handler's minimum level throughout its lifetime.
    Setting it to a [LevelVar] allows the level to be varied dynamically.
    A LevelVar holds a Level and is safe to read or write from multiple
    goroutines.
    To vary the level dynamically for an entire program, first initialize
    a global LevelVar:
    
    	var programLevel = new(slog.LevelVar) // Info by default
    
    Then use the LevelVar to construct a handler, and make it the default:
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 15 14:35:48 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(*JSONHandler).WithGroup", Method, 21},
    		{"(*Level).UnmarshalJSON", Method, 21},
    		{"(*Level).UnmarshalText", Method, 21},
    		{"(*LevelVar).Level", Method, 21},
    		{"(*LevelVar).MarshalText", Method, 21},
    		{"(*LevelVar).Set", Method, 21},
    		{"(*LevelVar).String", Method, 21},
    		{"(*LevelVar).UnmarshalText", Method, 21},
    		{"(*Logger).Debug", Method, 21},
    		{"(*Logger).DebugContext", Method, 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