Documentation
¶
Overview ¶
Package slog provides an slog implementation of the LoggerInterface interface.
Index ¶
- func Disabled() types.LoggerInterface
- func NewWrapper(handler slog.Handler) types.LoggerInterface
- func NewWrapperWithCloseAndFlush(handler slog.Handler, flush func(), close func()) types.LoggerInterface
- type Wrapper
- func (w *Wrapper) Close()
- func (w *Wrapper) Critical(v ...interface{}) error
- func (w *Wrapper) Criticalf(format string, params ...interface{}) error
- func (w *Wrapper) Debug(v ...interface{})
- func (w *Wrapper) Debugf(format string, params ...interface{})
- func (w *Wrapper) Error(v ...interface{}) error
- func (w *Wrapper) Errorf(format string, params ...interface{}) error
- func (w *Wrapper) Flush()
- func (w *Wrapper) Info(v ...interface{})
- func (w *Wrapper) Infof(format string, params ...interface{})
- func (w *Wrapper) SetAdditionalStackDepth(depth int) error
- func (w *Wrapper) SetContext(context interface{})
- func (w *Wrapper) Trace(v ...interface{})
- func (w *Wrapper) Tracef(format string, params ...interface{})
- func (w *Wrapper) Warn(v ...interface{}) error
- func (w *Wrapper) Warnf(format string, params ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWrapper ¶
func NewWrapper(handler slog.Handler) types.LoggerInterface
NewWrapper returns a new Wrapper implementing the LoggerInterface interface.
func NewWrapperWithCloseAndFlush ¶
func NewWrapperWithCloseAndFlush(handler slog.Handler, flush func(), close func()) types.LoggerInterface
NewWrapperWithCloseAndFlush returns a new Wrapper implementing the LoggerInterface interface, with a flush and close function.
Types ¶
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is a wrapper around the slog.Handler interface. It implements the LoggerInterface interface.
func (*Wrapper) Close ¶
func (w *Wrapper) Close()
Close flushes all the messages in the logger and closes it. It cannot be used after this operation.
func (*Wrapper) Critical ¶
Critical formats message using the default formats for its operands and writes to log with level = Critical
func (*Wrapper) Criticalf ¶
Criticalf formats message according to format specifier and writes to log with level = Critical.
func (*Wrapper) Debug ¶
func (w *Wrapper) Debug(v ...interface{})
Debug formats message using the default formats for its operands and writes to log with level = Debug
func (*Wrapper) Debugf ¶
Debugf formats message according to format specifier and writes to log with level = Debug.
func (*Wrapper) Error ¶
Error formats message using the default formats for its operands and writes to log with level = Error
func (*Wrapper) Errorf ¶
Errorf formats message according to format specifier and writes to log with level = Error.
func (*Wrapper) Info ¶
func (w *Wrapper) Info(v ...interface{})
Info formats message using the default formats for its operands and writes to log with level = Info
func (*Wrapper) Infof ¶
Infof formats message according to format specifier and writes to log with level = Info.
func (*Wrapper) SetAdditionalStackDepth ¶
SetAdditionalStackDepth sets the additional number of frames to skip by runtime.Caller
func (*Wrapper) SetContext ¶
func (w *Wrapper) SetContext(context interface{})
SetContext sets context which will be added to every log records
func (*Wrapper) Trace ¶
func (w *Wrapper) Trace(v ...interface{})
Trace formats message using the default formats for its operands and writes to log with level = Trace
func (*Wrapper) Tracef ¶
Tracef formats message according to format specifier and writes to log with level = Trace.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package filewriter provides a rolling file writer.
|
Package filewriter provides a rolling file writer. |
|
Package formatters provides functions to format log messages.
|
Package formatters provides functions to format log messages. |
|
Package handlers provides simple slog handlers
|
Package handlers provides simple slog handlers |