- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for LogAttrs (0.1 sec)
-
src/log/slog/logger.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 08 18:26:18 UTC 2024 - 10.2K bytes - Viewed (0) -
src/log/slog/logger_test.go
}) t.Run("attrs1", func(t *testing.T) { wantAllocs(t, 0, func() { dl.LogAttrs(ctx, LevelInfo, "", Int("a", 1)) }) wantAllocs(t, 0, func() { dl.LogAttrs(ctx, LevelInfo, "", Any("error", io.EOF)) }) }) t.Run("attrs3", func(t *testing.T) { wantAllocs(t, 0, func() { dl.LogAttrs(ctx, LevelInfo, "hello", Int("a", 1), String("b", "two"), Duration("c", time.Second)) }) })
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 10 21:25:30 UTC 2023 - 19.5K bytes - Viewed (0) -
src/log/slog/doc.go
without an allocation. For the most efficient log output, use [Logger.LogAttrs]. It is similar to [Logger.Log] but accepts only Attrs, not alternating keys and values; this allows it, too, to avoid allocation. The call logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) is the most efficient way to achieve the same output as
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 15 14:35:48 UTC 2024 - 12.3K bytes - Viewed (0) -
src/log/slog/handler.go
// // A Handler should treat WithGroup as starting a Group of Attrs that ends // at the end of the log event. That is, // // logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2)) // // should behave like // // logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) // // If the name is empty, WithGroup returns the receiver. WithGroup(name string) Handler }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Dec 05 18:18:13 UTC 2023 - 17.5K bytes - Viewed (0) -
api/go1.21.txt
pkg log/slog, func Int64(string, int64) Attr #56345 pkg log/slog, func Int64Value(int64) Value #56345 pkg log/slog, func Int(string, int) Attr #56345 pkg log/slog, func IntValue(int) Value #56345 pkg log/slog, func LogAttrs(context.Context, Level, string, ...Attr) #56345 pkg log/slog, func Log(context.Context, Level, string, ...interface{}) #56345 pkg log/slog, func New(Handler) *Logger #56345
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 07 09:39:17 UTC 2023 - 25.6K bytes - Viewed (0)