Documentation
¶
Overview ¶
Package log provides logging facilities for XxSql.
Package log provides logging facilities for XxSql.
Index ¶
- func Debug(format string, args ...any)
- func Error(format string, args ...any)
- func Fatal(format string, args ...any)
- func Info(format string, args ...any)
- func SetGlobal(l *Logger)
- func Warn(format string, args ...any)
- type BackupInfo
- type Level
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) Debug(format string, args ...any)
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Error(format string, args ...any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Fatal(format string, args ...any)
- func (l *Logger) Fatalf(format string, args ...any)
- func (l *Logger) GetLevel() Level
- func (l *Logger) Info(format string, args ...any)
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetLevelString(level string)
- func (l *Logger) Sync() error
- func (l *Logger) Warn(format string, args ...any)
- func (l *Logger) Warnf(format string, args ...any)
- type Option
- type Rotator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackupInfo ¶
BackupInfo represents information about a backup file.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a thread-safe logger with configurable output and rotation.
func (*Logger) SetLevelString ¶
SetLevelString sets the log level from a string.
type Option ¶
type Option func(*Logger)
Option is a functional option for Logger configuration.
func WithPrefix ¶
WithPrefix sets a prefix for all log messages.
func WithRotation ¶
WithRotation sets up log rotation.
func WithTimeFormat ¶
WithTimeFormat sets the time format for log messages.
type Rotator ¶
type Rotator struct {
// contains filtered or unexported fields
}
Rotator handles log file rotation.
func NewRotator ¶
NewRotator creates a new log rotator.
func (*Rotator) ForceRotate ¶
ForceRotate forces a rotation of the log file.
func (*Rotator) GetBackupInfo ¶
func (r *Rotator) GetBackupInfo(logPath string) ([]BackupInfo, error)
GetBackupInfo returns information about current backup files.
func (*Rotator) RotateWithPath ¶
RotateWithPath rotates the log file at the given path. Returns the new file handle after rotation.