Documentation ¶
Overview ¶
Package zerolog provides a zerolog based logger we use in our servers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLogWriter ¶
func DefaultLogWriter() zerolog.ConsoleWriter
DefaultLogWriter returns a zerolog.ConsoleWriter set to use os.Stderr as io.Writer.
func New ¶
New creates a new slog.Logger wrapper for a zerolog.Logger using the given io.Writer and restricted to entries above the given slog.LogLevel threshold.
Types ¶
type Config ¶
type Config struct { // Level is the threshold for the created slog.Logger Level slog.LogLevel // Logger optionally defines a zerolog.Logger to use Logger *zerolog.Logger // Writer defines where the zerolog.Logger would write, // if no Logger is specified Writer io.Writer }
Config describes how the Zerolog wrapper will be created.
func (*Config) SetConsoleWriter ¶
func (c *Config) SetConsoleWriter(options ...func(*zerolog.ConsoleWriter))
SetConsoleWriter binds the Config to a new zerolog.ConsoleWriter.
type ConsoleWriter ¶
type ConsoleWriter = zerolog.ConsoleWriter
ConsoleWriter is an alias of zerolog.ConsoleWriter.
Click to show internal directories.
Click to hide internal directories.