Documentation ¶
Index ¶
- Constants
- Variables
- func InitInstance(config LogConfig)
- type LogConfig
- type Logger
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Fatal(msg string, args ...any)
- func (l *Logger) Fatalf(format string, args ...any)
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) IsLevelEnabled(level slog.Level) bool
- func (l *Logger) Trace(msg string, args ...any)
- func (l *Logger) Tracef(format string, args ...any)
- func (l *Logger) Warnf(format string, args ...any)
- func (l *Logger) With(args ...any) *Logger
- func (l *Logger) WithFields(fields map[string]any) *Logger
Constants ¶
View Source
const ( LevelTrace = slog.Level(-8) LevelFatal = slog.Level(12) )
View Source
const ( EnvLogFormat = "LOG_FORMAT" EnvLogLevel = "LOG_LEVEL" )
View Source
const ( LogFormatJson = "json" LogFormatText = "text" )
Variables ¶
View Source
var LevelMap = invertMap(LevelNames)
View Source
var LevelNames = map[slog.Leveler]string{ LevelTrace: "TRACE", LevelFatal: "FATAL", }
Functions ¶
func InitInstance ¶
func InitInstance(config LogConfig)
Types ¶
type Logger ¶
func GetInstance ¶
func GetInstance() *Logger
func NewDefaultLogger ¶
func NewDefaultLogger() *Logger
Click to show internal directories.
Click to hide internal directories.