Documentation
¶
Overview ¶
Package logger provides a small, dependency-free structured logger used across the framework. It supports colored output, leveled logs, SQL query logging, and slow-query reporting. Drop-in replacements can be wired by implementing the Logger interface in your application.
Index ¶
- type Level
- type Logger
- func (l *Logger) Debug(args ...any)
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Error(args ...any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Info(args ...any)
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) SQL(_ context.Context, query string, args []any, took time.Duration, err error)
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SlowSQL(_ context.Context, query string, args []any, took time.Duration, err error)
- func (l *Logger) Warn(args ...any)
- func (l *Logger) Warnf(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger writes leveled & SQL-aware log lines to an io.Writer.
Click to show internal directories.
Click to hide internal directories.