Documentation ¶
Index ¶
- func Debug(msg string, args ...any)
- func Debugf(format string, args ...any)
- func DefaultLogger() log.Logger
- func Error(err error, msg string, args ...any)
- func Errorf(err error, format string, args ...any)
- func Info(msg string, args ...any)
- func Infof(format string, args ...any)
- func Warn(msg string, args ...any)
- func Warnf(format string, args ...any)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLogger ¶ added in v1.5.0
DefaultLogger returns the default instance of logfmt logger
func Error ¶
Error logs a line with level error. If err is not nil it adds only the msg string or vice-versa. Otherwise adds both.
Types ¶
type Logger ¶ added in v1.5.0
type Logger interface { Info(msg string, args ...any) Warn(msg string, args ...any) Debug(msg string, args ...any) Error(err error, msg string, args ...any) Infof(format string, args ...any) Warnf(format string, args ...any) Debugf(format string, args ...any) Errorf(err error, format string, args ...any) WithTraceId(ctx context.Context) Logger WithFields(fields map[string]any) Logger WithSensitive(bool) Logger SetSensitive(val bool) }
Logger represents the methods supported by slog
func NewLogger ¶ added in v1.5.0
func NewLogger() Logger
NewLogger returns a new instance of Logger.
func WithFields ¶
WithFields returns WithFields using the defaultLoggerWrapper.
func WithTraceId ¶
WithTraceId returns WithTraceId using the defaultLoggerWrapper.
Click to show internal directories.
Click to hide internal directories.