Versions in this module Expand all Collapse all v0 v0.5.1 Sep 30, 2024 Changes in this version + var DefaultLogger = New() + var DefaultWriter = os.Stdout + func Debug(args ...interface{}) + func Debugf(msg string, args ...interface{}) + func Error(args ...interface{}) + func Errorf(msg string, args ...interface{}) + func Info(args ...interface{}) + func Infof(msg string, args ...interface{}) + func Log(level Level, offset int, args ...interface{}) + func Logf(level Level, offset int, msg string, args ...interface{}) + func NewConsoleWriter(cfg ConsoleConfig, out io.Writer) io.Writer + func Trace(args ...interface{}) + func Tracef(msg string, args ...interface{}) + func Warn(args ...interface{}) + func Warnf(msg string, args ...interface{}) + type ConsoleConfig struct + Colorful bool + type ConsoleWriter struct + func (cw *ConsoleWriter) Write(p []byte) (n int, err error) + func (cw *ConsoleWriter) WriteLog(p []byte, level Level, when time.Time) (n int, err error) + type Level int8 + const DebugLevel + const ErrorLevel + const InfoLevel + const TraceLevel + const WarnLevel + func ParseLevel(text string) (Level, error) + func (l *Level) UnmarshalText(text []byte) error + func (l Level) Enabled(lvl Level) bool + func (l Level) LogPrefix() string + func (l Level) MarshalText() ([]byte, error) + func (l Level) String() string + type Logger struct + func New(opts ...Option) *Logger + func (l *Logger) Debug(args ...interface{}) + func (l *Logger) Debugf(msg string, args ...interface{}) + func (l *Logger) Error(args ...interface{}) + func (l *Logger) Errorf(msg string, args ...interface{}) + func (l *Logger) Info(args ...interface{}) + func (l *Logger) Infof(msg string, args ...interface{}) + func (l *Logger) Log(level Level, offset int, args ...interface{}) + func (l *Logger) Logf(level Level, offset int, msg string, args ...interface{}) + func (l *Logger) Trace(args ...interface{}) + func (l *Logger) Tracef(msg string, args ...interface{}) + func (l *Logger) Warn(args ...interface{}) + func (l *Logger) Warnf(msg string, args ...interface{}) + func (l *Logger) WithOptions(opts ...Option) *Logger + type Option interface + func AddCallerSkip(skip int) Option + func WithCaller(enabled bool) Option + func WithClock(clock clock.Clock) Option + func WithLevel(l Level) Option + func WithOutput(w io.Writer) Option + type RotateFileConfig struct + Clock clock.Clock + FileName string + MaxDays int + Mode RotateFileMode + type RotateFileMode string + const RotateFileModeDaily + const RotateFileModeNone + type RotateFileWriter struct + func NewRotateFileWriter(cfg RotateFileConfig) *RotateFileWriter + func (fw *RotateFileWriter) Close() error + func (fw *RotateFileWriter) Init() + func (fw *RotateFileWriter) Rotate() error + func (fw *RotateFileWriter) Write(p []byte) (n int, err error) + func (fw *RotateFileWriter) WriteLog(p []byte, _ Level) (int, error) + type Writer interface + WriteLog func([]byte, Level, time.Time) (n int, err error)