Documentation ¶
Overview ¶
Package logger defines the logger interface.
Index ¶
- func Debug(msg string, args ...any)
- func DebugContext(ctx context.Context, msg string, args ...any)
- func ErrAttr(err error) slog.Attr
- func Error(msg string, args ...any)
- func ErrorContext(ctx context.Context, msg string, args ...any)
- func GetLevelByName(name string) slog.Leveler
- func Info(msg string, args ...any)
- func InfoContext(ctx context.Context, msg string, args ...any)
- func ReplaceSourceAttr(groups []string, a slog.Attr) slog.Attr
- func SetHandler(handler slog.Handler)
- func SetLevel(level slog.Leveler)
- func Warn(msg string, args ...any)
- func WarnContext(ctx context.Context, msg string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugContext ¶
DebugContext logs at LevelDebug with the given context.
func ErrorContext ¶
ErrorContext logs at LevelError with the given context.
func GetLevelByName ¶
GetLevelByName human readable logger level
func InfoContext ¶
InfoContext logs at LevelInfo with the given context.
func ReplaceSourceAttr ¶
ReplaceSourceAttr source 格式化为 dir/file:line 格式
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.