Documentation ¶
Index ¶
- Constants
- func Debug(msg any, args ...slog.Attr)
- func Debugf(msg string, a ...any)
- func Error(msg any, args ...slog.Attr)
- func Errorf(msg string, a ...any)
- func Fatal(msg any, args ...slog.Attr)
- func Fatalf(msg string, a ...any)
- func Info(msg any, args ...slog.Attr)
- func Infof(msg string, a ...any)
- func Panic(msg any, args ...slog.Attr)
- func Panicf(msg string, a ...any)
- func SetDefault(l *Logger)
- func Trace(msg any, args ...slog.Attr)
- func Tracef(msg string, a ...any)
- func Warn(msg any, args ...slog.Attr)
- func Warnf(msg string, a ...any)
- type Attrs
- type CommonHandler
- func (h *CommonHandler) Enabled(ctx context.Context, level slog.Level) bool
- func (h *CommonHandler) Handle(ctx context.Context, r slog.Record) (err error)
- func (h *CommonHandler) SkipCaller(skip int) Handler
- func (h *CommonHandler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *CommonHandler) WithGroup(name string) slog.Handler
- type Config
- type Handler
- type Level
- type Logger
- func (l *Logger) Caller(skip int) *Logger
- func (l *Logger) Debug(msg any, args ...slog.Attr)
- func (l *Logger) Debugf(msg string, a ...any)
- func (l *Logger) Error(msg any, args ...slog.Attr)
- func (l *Logger) Errorf(msg string, a ...any)
- func (l *Logger) Fatal(msg any, args ...slog.Attr)
- func (l *Logger) Fatalf(msg string, a ...any)
- func (l *Logger) Info(msg any, args ...slog.Attr)
- func (l *Logger) Infof(msg string, a ...any)
- func (l *Logger) Log(ctx context.Context, level Level, msg any, args ...slog.Attr)
- func (l *Logger) Panic(msg any, args ...slog.Attr)
- func (l *Logger) Panicf(msg string, a ...any)
- func (l *Logger) Trace(msg any, args ...slog.Attr)
- func (l *Logger) Tracef(msg string, a ...any)
- func (l *Logger) Warn(msg any, args ...slog.Attr)
- func (l *Logger) Warnf(msg string, a ...any)
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
func SetDefault(l *Logger)
Types ¶
type CommonHandler ¶
func JSONWriter ¶
func JSONWriter(w io.Writer) *CommonHandler
func TextWriter ¶
func TextWriter(w io.Writer) *CommonHandler
func (*CommonHandler) SkipCaller ¶
func (h *CommonHandler) SkipCaller(skip int) Handler
type Level ¶
func (Level) ColorString ¶
Click to show internal directories.
Click to hide internal directories.