- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for LevelInfo (0.16 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
src/log/slog/record_test.go
r2.AddAttrs(Int("p", 2)) check(r1, r1Attrs) // r1 is unchanged check(r2, append(slices.Clip(r1Attrs), Int("p", 2))) } func newRecordWithAttrs(as []Attr) Record { r := NewRecord(time.Now(), LevelInfo, "", 0) r.AddAttrs(as...) return r } func attrsSlice(r Record) []Attr { s := make([]Attr, 0, r.NumAttrs()) r.Attrs(func(a Attr) bool { s = append(s, a); return true }) return s }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 07 15:10:55 UTC 2023 - 4K bytes - Viewed (0) -
src/compress/flate/huffman_code.go
lfs byFreq // stored to avoid repeated allocation in generate } type literalNode struct { literal uint16 freq int32 } // A levelInfo describes the state of the constructed tree for a given depth. type levelInfo struct { // Our level. for better printing level int32 // The frequency of the last node at this level lastFreq int32
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 18 17:59:44 UTC 2022 - 9.7K bytes - Viewed (0)