MCPcopy
hub / github.com/rs/zerolog / hasTimestampHook

Method hasTimestampHook

slog.go:77–84  ·  view source on GitHub ↗

hasTimestampHook reports whether the logger has a timestampHook installed, which would cause duplicate timestamp fields if we also emit record.Time.

()

Source from the content-addressed store, hash-verified

75// hasTimestampHook reports whether the logger has a timestampHook installed,
76// which would cause duplicate timestamp fields if we also emit record.Time.
77func (h *SlogHandler) hasTimestampHook() bool {
78 for _, hook := range h.logger.hooks {
79 if _, ok := hook.(timestampHook); ok {
80 return true
81 }
82 }
83 return false
84}
85
86// WithAttrs returns a new Handler with the given attributes pre-attached.
87// These attributes will be included in every subsequent log record.

Callers 1

HandleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected