Documentation
¶
Index ¶
- type Logger
- func (l *Logger) Debug(msg string, args ...any)
- func (l *Logger) Debugf(msg string, args ...any)
- func (l *Logger) Error(msg string, args ...any)
- func (l *Logger) Errorf(msg string, args ...any)
- func (l *Logger) Info(msg string, args ...any)
- func (l *Logger) Infof(msg string, args ...any)
- func (l *Logger) Warn(msg string, args ...any)
- func (l *Logger) Warnf(msg string, args ...any)
- func (l *Logger) With(args ...any) *Logger
- type StackFrame
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
func (*Logger) Debug ¶
Debug wraps slog.Debug to add call stack information (and similarly for the following Logger methods...) Note that we do not wrap the entire slog logging interface, so, for example, WarnContext and Log do not have callstacks included.
We also wrap the logging methods to allow a nil *Logger, in which case debug and info messages are discarded (though warnings and errors still go through to slog.)
type StackFrame ¶
type StackFrame struct { File string `json:"file"` Line int `json:"line"` Function string `json:"function"` }
func Callstack ¶
func Callstack(fr []StackFrame) []StackFrame
Click to show internal directories.
Click to hide internal directories.