MCPcopy
hub / github.com/uber-go/zap / newSlog

Function newSlog

benchmarks/slog_test.go:28–30  ·  view source on GitHub ↗
(fields ...slog.Attr)

Source from the content-addressed store, hash-verified

26)
27
28func newSlog(fields ...slog.Attr) *slog.Logger {
29 return slog.New(slog.NewJSONHandler(io.Discard, nil).WithAttrs(fields))
30}
31
32func newDisabledSlog(fields ...slog.Attr) *slog.Logger {
33 return slog.New(slog.NewJSONHandler(io.Discard, &slog.HandlerOptions{Level: slog.LevelError}).WithAttrs(fields))

Callers 3

BenchmarkWithoutFieldsFunction · 0.85
BenchmarkAddingFieldsFunction · 0.85

Calls 1

WithAttrsMethod · 0.80

Tested by

no test coverage detected