Documentation
¶
Index ¶
- Constants
- func Debug(msg string, args ...any)
- func DebugContext(ctx context.Context, msg string, args ...any)
- func Enabled(ctx context.Context, level slog.Level) bool
- func Error(msg string, args ...any)
- func ErrorContext(ctx context.Context, msg string, args ...any)
- func Fatal(v ...any)
- func Fatalf(format string, v ...any)
- func Fatalln(v ...any)
- func File() string
- func Flags() int
- func Info(msg string, args ...any)
- func InfoContext(ctx context.Context, msg string, args ...any)
- func Level() *slog.LevelVar
- func ListenRotateSignal(r Rotatable, sig ...os.Signal)
- func Log(ctx context.Context, level slog.Level, msg string, args ...any)
- func LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)
- func LoggerHandler() slog.Handler
- func Output(calldepth int, s string) error
- func Panic(v ...any)
- func Panicf(format string, v ...any)
- func Panicln(v ...any)
- func Prefix() string
- func Print(v ...any)
- func Printf(format string, v ...any)
- func Println(v ...any)
- func Rotate()
- func SetExtra(extra io.Writer)
- func SetFile(file string)
- func SetFlags(flag int)
- func SetHandler(h slog.Handler)
- func SetLevel(level slog.Level)
- func SetOutput(file string, extra io.Writer)
- func SetPrefix(prefix string)
- func Warn(msg string, args ...any)
- func WarnContext(ctx context.Context, msg string, args ...any)
- func Writer() io.Writer
- type Logger
- func (l *Logger) Debug(msg string, args ...any)
- func (l *Logger) DebugContext(ctx context.Context, msg string, args ...any)
- func (l *Logger) Enabled(ctx context.Context, level slog.Level) bool
- func (l *Logger) Error(msg string, args ...any)
- func (l *Logger) ErrorContext(ctx context.Context, msg string, args ...any)
- func (l *Logger) File() string
- func (l *Logger) Info(msg string, args ...any)
- func (l *Logger) InfoContext(ctx context.Context, msg string, args ...any)
- func (l *Logger) Level() *slog.LevelVar
- func (l *Logger) Log(ctx context.Context, level slog.Level, msg string, args ...any)
- func (l *Logger) LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)
- func (l *Logger) LoggerHandler() slog.Handler
- func (l *Logger) Rotate()
- func (l *Logger) SetExtra(extra io.Writer)
- func (l *Logger) SetFile(file string)
- func (l *Logger) SetHandler(h slog.Handler)
- func (l *Logger) SetLevel(level slog.Level)
- func (l *Logger) SetOutput(file string, extra io.Writer)
- func (l *Logger) Warn(msg string, args ...any)
- func (l *Logger) WarnContext(ctx context.Context, msg string, args ...any)
- func (l *Logger) With(args ...any) *Logger
- func (l *Logger) WithGroup(name string) *Logger
- func (l *Logger) Write(b []byte) (int, error)
- type Rotatable
Constants ¶
View Source
const ( Ldate = 1 << iota // the date in the local time zone: 2009/01/23 Ltime // the time in the local time zone: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone Lmsgprefix // move the "prefix" from the beginning of the line to before the message LstdFlags = Ldate | Ltime // initial values for the standard logger )
Variables ¶
This section is empty.
Functions ¶
func ListenRotateSignal ¶
func LoggerHandler ¶
func SetHandler ¶
Types ¶
type Logger ¶
func (*Logger) DebugContext ¶
func (*Logger) ErrorContext ¶
func (*Logger) InfoContext ¶
func (*Logger) LoggerHandler ¶
func (*Logger) SetHandler ¶
func (*Logger) WarnContext ¶
Click to show internal directories.
Click to hide internal directories.