Documentation ¶
Overview ¶
Package zerolog provides a slog.Logger adaptor using a github.com/rs/zerolog Logger as backend.
Index ¶
- func New(logger *zerolog.Logger) slog.Logger
- type Logger
- func (zl *Logger) Debug() slog.Logger
- func (zl *Logger) Enabled() bool
- func (zl *Logger) Error() slog.Logger
- func (zl *Logger) Fatal() slog.Logger
- func (zl *Logger) Info() slog.Logger
- func (zl *Logger) NewWithCallback(fn func(ev *zerolog.Event)) *Logger
- func (zl *Logger) Panic() slog.Logger
- func (zl *Logger) Print(args ...any)
- func (zl *Logger) Printf(format string, args ...any)
- func (zl *Logger) Println(args ...any)
- func (zl *Logger) Warn() slog.Logger
- func (zl *Logger) WithEnabled() (slog.Logger, bool)
- func (zl *Logger) WithField(label string, value any) slog.Logger
- func (zl *Logger) WithFields(fields map[string]any) slog.Logger
- func (zl *Logger) WithLevel(level slog.LogLevel) slog.Logger
- func (zl *Logger) WithStack(skip int) slog.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is an adaptor for using github.com/rs/zerolog as slog.Logger.
func (*Logger) NewWithCallback ¶
NewWithCallback creates a new zerolog.Event using a callback to modify it.
func (*Logger) Println ¶
Println adds a log entry with arguments handled in the manner of fmt.Println.
func (*Logger) WithEnabled ¶
WithEnabled tells if the logger would log or not
func (*Logger) WithFields ¶
WithFields adds fields to the Event Context
Click to show internal directories.
Click to hide internal directories.