Documentation ¶
Index ¶
- func MustParseLevel(lvlStr string) slog.Level
- func NewExportHandler(ctx context.Context, next slog.Handler, cfg ExportConfig) slog.Handler
- func NewRateLimiterHandler(ctx context.Context, next slog.Handler, cfg RateLimiterConfig) slog.Handler
- type Config
- type ExportConfig
- type ExportFunc
- type ExportHandler
- type Logger
- func (l *Logger) Debug(msg string)
- func (l *Logger) Debugf(format string, a ...any)
- func (l *Logger) Error(msg string)
- func (l *Logger) Errorf(format string, a ...any)
- func (l *Logger) Fatal(msg string)
- func (l *Logger) Info(msg string)
- func (l *Logger) Infof(format string, a ...any)
- func (l *Logger) IsEnabled(lvl slog.Level) bool
- func (l *Logger) Warn(msg string)
- func (l *Logger) Warnf(format string, a ...any)
- func (l *Logger) With(args ...any) *Logger
- func (l *Logger) WithField(k, v string) *Logger
- type RateLimiterConfig
- type RateLimiterHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustParseLevel ¶
func NewExportHandler ¶
func NewRateLimiterHandler ¶
Types ¶
type Config ¶
type Config struct { Ctx context.Context RateLimiter RateLimiterConfig Level slog.Level AddSource bool Output io.Writer Export ExportConfig }
type ExportConfig ¶
type ExportConfig struct { ExportFunc ExportFunc MinLevel slog.Level }
type ExportHandler ¶
type ExportHandler struct {
// contains filtered or unexported fields
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewTestLog ¶
func NewTestLog() *Logger
Click to show internal directories.
Click to hide internal directories.