Documentation ¶
Index ¶
- Constants
- type Logger
- type Option
- type SLogger
- func (d *SLogger) Debug(msg string, attrs ...slog.Attr)
- func (d *SLogger) Error(msg string, attrs ...slog.Attr)
- func (d *SLogger) Info(msg string, attrs ...slog.Attr)
- func (d *SLogger) SetLevel(level slog.Level)
- func (d *SLogger) Trace(msg string, attrs ...slog.Attr)
- func (d *SLogger) Warn(msg string, attrs ...slog.Attr)
- func (d *SLogger) WithErr(attrs ...slog.Attr) Logger
- func (d *SLogger) WithOut(attrs ...slog.Attr) Logger
Constants ¶
View Source
const ( LevelTrace = slog.Level(-8) LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError )
View Source
const ( StdOut = "stdout" StdErr = "stderr" HourPattern = ".%Y%m%d%H" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Trace(msg string, attrs ...slog.Attr) Debug(msg string, attrs ...slog.Attr) Info(msg string, attrs ...slog.Attr) Warn(msg string, attrs ...slog.Attr) Error(msg string, attrs ...slog.Attr) SetLevel(level slog.Level) WithOut(attrs ...slog.Attr) Logger WithErr(attrs ...slog.Attr) Logger }
type Option ¶
type Option func(*option)
func WithErrFile ¶
func WithJsonFormat ¶
func WithJsonFormat() Option
func WithOutFile ¶
func WithSkipCaller ¶
type SLogger ¶
type SLogger struct {
// contains filtered or unexported fields
}
func NewSLogger ¶
Click to show internal directories.
Click to hide internal directories.