Documentation
¶
Overview ¶
Package logger defines a common logging interface and provides implementations for various logging libraries.
Index ¶
- type Logger
- type Nop
- func (Nop) Debug(_ ...interface{})
- func (Nop) Debugf(_ string, _ ...interface{})
- func (Nop) Errorf(_ string, _ ...interface{})
- func (Nop) Fatal(_ ...interface{})
- func (Nop) Fatalf(_ string, _ ...interface{})
- func (Nop) Info(_ ...interface{})
- func (Nop) Infof(_ string, _ ...interface{})
- func (Nop) Warnf(_ string, _ ...interface{})
- type Slog
- func (s *Slog) Debug(args ...interface{})
- func (s *Slog) Debugf(format string, args ...interface{})
- func (s *Slog) Errorf(format string, args ...interface{})
- func (s *Slog) Fatal(args ...interface{})
- func (s *Slog) Fatalf(format string, args ...interface{})
- func (s *Slog) Info(args ...interface{})
- func (s *Slog) Infof(format string, args ...interface{})
- func (s *Slog) Warnf(format string, args ...interface{})
- func (s *Slog) WithContext(_ context.Context) *Slog
- type Zerolog
- func (z *Zerolog) Debug(args ...interface{})
- func (z *Zerolog) Debugf(format string, args ...interface{})
- func (z *Zerolog) Errorf(format string, args ...interface{})
- func (z *Zerolog) Fatal(args ...interface{})
- func (z *Zerolog) Fatalf(format string, args ...interface{})
- func (z *Zerolog) Info(args ...interface{})
- func (z *Zerolog) Infof(format string, args ...interface{})
- func (z *Zerolog) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
// Errorf logs a message at the error level.
Errorf(format string, args ...interface{})
// Fatalf logs a message at the fatal level and calls os.Exit(1).
Fatalf(format string, args ...interface{})
// Fatal logs a message at the fatal level and calls os.Exit(1).
Fatal(args ...interface{})
// Infof logs a message at the info level.
Infof(format string, args ...interface{})
// Info logs a message at the info level.
Info(args ...interface{})
// Warnf logs a message at the warn level.
Warnf(format string, args ...interface{})
// Debugf logs a message at the debug level.
Debugf(format string, args ...interface{})
// Debug logs a message at the debug level.
Debug(args ...interface{})
}
Logger is an interface for logging.
type Nop ¶
type Nop struct{}
Nop is a logger that does nothing.
func (Nop) Fatal ¶
func (Nop) Fatal(_ ...interface{})
Fatal logs a message at the fatal level and calls os.Exit(1).
type Slog ¶
type Slog struct {
// contains filtered or unexported fields
}
Slog is a logger that uses the standard library's log/slog package.
func (*Slog) Debug ¶
func (s *Slog) Debug(args ...interface{})
Debug logs a message at the debug level.
func (*Slog) Fatal ¶
func (s *Slog) Fatal(args ...interface{})
Fatal logs a message at the fatal level and calls os.Exit(1).
type Zerolog ¶
type Zerolog struct {
// contains filtered or unexported fields
}
Zerolog is a logger that uses the zerolog package.
func (*Zerolog) Debug ¶
func (z *Zerolog) Debug(args ...interface{})
Debug logs a message at the debug level.
func (*Zerolog) Fatal ¶
func (z *Zerolog) Fatal(args ...interface{})
Fatal logs a message at the fatal level and calls os.Exit(1).
func (*Zerolog) Info ¶
func (z *Zerolog) Info(args ...interface{})
Info logs a message at the info level.
Click to show internal directories.
Click to hide internal directories.