Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for LevelInfo (0.51 sec)

  1. src/log/slog/level_test.go

    	for _, test := range []struct {
    		in   string
    		want Level
    	}{
    		{"DEBUG", LevelDebug},
    		{"INFO", LevelInfo},
    		{"WARN", LevelWarn},
    		{"ERROR", LevelError},
    		{"debug", LevelDebug},
    		{"iNfo", LevelInfo},
    		{"INFO+87", LevelInfo + 87},
    		{"Error-18", LevelError - 18},
    		{"Error-8", LevelInfo},
    	} {
    		var got Level
    		if err := got.parse(test.in); err != nil {
    			t.Fatalf("%q: %v", test.in, err)
    		}
    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_test.go

    	logger.Log(ctx, LevelInfo, "")
    	check(0)
    	logger.LogAttrs(ctx, LevelInfo, "")
    	check(1)
    	logger.Debug("")
    	check(2)
    	logger.Info("")
    	check(3)
    	logger.Warn("")
    	check(4)
    	logger.Error("")
    	check(5)
    	Debug("")
    	check(6)
    	Info("")
    	check(7)
    	Warn("")
    	check(8)
    	Error("")
    	check(9)
    	Log(ctx, LevelInfo, "")
    	check(10)
    	LogAttrs(ctx, LevelInfo, "")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 10 21:25:30 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  3. src/log/slog/level.go

    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.
    // If the level is between named values, then
    // an integer is appended to the uppercased name.
    // Examples:
    //
    //	LevelWarn.String() => "WARN"
    //	(LevelInfo+2).String() => "INFO+2"
    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/logger.go

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

    package benchmarks
    
    import (
    	"bytes"
    	"context"
    	"log/slog"
    	"slices"
    	"testing"
    )
    
    func TestHandlers(t *testing.T) {
    	ctx := context.Background()
    	r := slog.NewRecord(testTime, slog.LevelInfo, testMessage, 0)
    	r.AddAttrs(testAttrs...)
    	t.Run("text", func(t *testing.T) {
    		var b bytes.Buffer
    		h := newFastTextHandler(&b)
    		if err := h.Handle(ctx, r); err != nil {
    			t.Fatal(err)
    		}
    		got := b.String()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  6. src/log/slog/example_log_level_test.go

    	defer log.SetFlags(log.Flags()) // revert changes after the example
    	log.SetFlags(0)
    	defer log.SetOutput(log.Writer()) // revert changes after the example
    	log.SetOutput(os.Stdout)
    
    	// Default logging level is slog.LevelInfo.
    	log.Print("log debug") // log debug
    	slog.Debug("debug")    // no output
    	slog.Info("info")      // INFO info
    
    	// Set the default logging level to slog.LevelDebug.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 10 21:25:30 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  7. src/log/slog/handler_test.go

    			sub2 := h.WithAttrs([]Attr{Bool("sub2", true)})
    			var wg sync.WaitGroup
    			for i := 0; i < count; i++ {
    				sub1Record := NewRecord(time.Time{}, LevelInfo, "hello from sub1", 0)
    				sub1Record.AddAttrs(Int("i", i))
    				sub2Record := NewRecord(time.Time{}, LevelInfo, "hello from sub2", 0)
    				sub2Record.AddAttrs(Int("i", i))
    				wg.Add(1)
    				go func() {
    					defer wg.Done()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 02 13:57:53 UTC 2023
    - 19.6K bytes
    - Viewed (0)
  8. src/log/slog/doc.go

    suppressing debug logging until it is needed.
    The built-in handlers can be configured with the minimum level to output by
    setting [HandlerOptions.Level].
    The program's `main` function typically does this.
    The default value is LevelInfo.
    
    Setting the [HandlerOptions.Level] field to a [Level] value
    fixes the handler's minimum level throughout its lifetime.
    Setting it to a [LevelVar] allows the level to be varied dynamically.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 15 14:35:48 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  9. src/log/slog/handler.go

    	AddSource bool
    
    	// Level reports the minimum record level that will be logged.
    	// The handler discards records with lower levels.
    	// If Level is nil, the handler assumes LevelInfo.
    	// The handler calls Level.Level for each record processed;
    	// to adjust the minimum level dynamically, use a LevelVar.
    	Level Leveler
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 18:18:13 UTC 2023
    - 17.5K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"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},
    		{"LogValuer", Type, 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