Documentation
¶
Overview ¶
Package logger Tellstone Cloud-Native In-Memory Database File: log.go Description: Public logging contract — the Logger interface, levels, and structured fields. The internal/log package re-exports these types so internal packages and server code keep using their existing log.Level / log.Logger identifiers. Defining the contract here (a non-internal package) lets public packages like client accept and build loggers without leaking internal imports to external consumers.
Authors:
Maximilian Hagen
Package logger Tellstone Cloud-Native In-Memory Database File: logger.go Description: Adapter that bridges the logging contract to Go's structured slog logger (JSON output).
Authors:
Maximilian Hagen
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶ added in v1.1.0
type Field struct {
Key string
StrVal string
IntVal int
UintVal uint64
BoolVal bool
FloatVal float64
Type FieldType
}
Field is a structured key/value pair attached to a log message. The typed accessors below build one without boxing, keeping the hot path allocation-free.
type FieldType ¶ added in v1.1.0
type FieldType uint8
FieldType discriminates the typed value carried by a Field.
type Level ¶ added in v1.1.0
type Level uint8
Level identifies the severity of a log message.
func ParseLogLevel ¶ added in v1.1.0
ParseLogLevel maps a string level name to a Level, defaulting to Info.
type Logger ¶ added in v1.1.0
Logger is the logging surface used across the codebase. Implementations must be safe for concurrent use.
func NewNoOpLogger ¶ added in v1.1.0
func NewNoOpLogger() Logger
NewNoOpLogger returns a Logger that discards every message. It is the default for optional logging: zero allocation, zero output.
func NewSlogLogger ¶
NewSlogLogger builds a Logger backed by slog's JSON handler on stdout. Logging is disabled by default in every other component; callers opt in.
type SlogAdapter ¶
type SlogAdapter struct {
// contains filtered or unexported fields
}
func (*SlogAdapter) Enabled ¶
func (s *SlogAdapter) Enabled(level Level) bool