Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for LevelInfo (0.31 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/example_custom_levels_test.go

    		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
    		// LevelInfo, which would drop Debug and Trace logs.
    		Level: LevelTrace,
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 3K bytes
    - Viewed (0)
  4. src/log/slog/internal/benchmarks/benchmarks_test.go

    					func() {
    						logger.LogAttrs(nil, slog.LevelInfo, testMessage,
    							slog.String("string", testString),
    							slog.Int("status", testInt),
    							slog.Duration("duration", testDuration),
    							slog.Time("time", testTime),
    							slog.Any("error", testError),
    						)
    					},
    				},
    				{
    					"5 args ctx",
    					func() {
    						logger.LogAttrs(ctx, slog.LevelInfo, testMessage,
    							slog.String("string", testString),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. src/log/slog/example_wrap_test.go

    func Infof(logger *slog.Logger, format string, args ...any) {
    	if !logger.Enabled(context.Background(), slog.LevelInfo) {
    		return
    	}
    	var pcs [1]uintptr
    	runtime.Callers(2, pcs[:]) // skip [Callers, Infof]
    	r := slog.NewRecord(time.Now(), slog.LevelInfo, fmt.Sprintf(format, args...), pcs[0])
    	_ = logger.Handler().Handle(context.Background(), r)
    }
    
    func Example_wrapping() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 04 18:32:54 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  8. tools/bug-report/pkg/processlog/processlog.go

    	"strings"
    	"time"
    
    	"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\.:]+)(.*)`)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 19 21:44:33 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  9. src/log/slog/json_handler_test.go

    		},
    	} {
    		t.Run(test.name, func(t *testing.T) {
    			var buf bytes.Buffer
    			h := NewJSONHandler(&buf, &test.opts)
    			r := NewRecord(testTime, LevelInfo, "m", 0)
    			r.AddAttrs(Int("a", 1), Any("m", map[string]int{"b": 2}))
    			if err := h.Handle(context.Background(), r); err != nil {
    				t.Fatal(err)
    			}
    			got := strings.TrimSuffix(buf.String(), "\n")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  10. src/log/slog/text_handler_test.go

    					strings.ToUpper,
    				},
    			} {
    				t.Run(opts.name, func(t *testing.T) {
    					var buf bytes.Buffer
    					h := NewTextHandler(&buf, &opts.opts)
    					r := NewRecord(testTime, LevelInfo, "a message", 0)
    					r.AddAttrs(test.attr)
    					if err := h.Handle(context.Background(), r); err != nil {
    						t.Fatal(err)
    					}
    					got := buf.String()
    					// Remove final newline.
    					got = got[:len(got)-1]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 22 19:05:59 UTC 2023
    - 3.8K bytes
    - Viewed (0)
Back to top