Documentation ¶
Overview ¶
file 使用文件方式记录日志
Index ¶
- func New(ctx context.Context, fileName string, maxLevel logger.Level) logger.Logger
- func NewWithoutFlag(ctx context.Context, fileName string, maxLevel logger.Level) logger.Logger
- type FileLogger
- func (l *FileLogger) CanLog(level logger.Level) bool
- func (l *FileLogger) Log(level logger.Level, format string, params ...any)
- func (l *FileLogger) LogAlter(format string, params ...any)
- func (l *FileLogger) LogCrit(format string, params ...any)
- func (l *FileLogger) LogDebug(format string, params ...any)
- func (l *FileLogger) LogEmerg(format string, params ...any)
- func (l *FileLogger) LogError(format string, params ...any)
- func (l *FileLogger) LogInfo(format string, params ...any)
- func (l *FileLogger) LogNotice(format string, params ...any)
- func (l *FileLogger) LogWarning(format string, params ...any)
- func (l *FileLogger) SetOutput(out io.Writer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileLogger ¶
type FileLogger struct { Logger *log.Logger MaxLevel logger.Level // contains filtered or unexported fields }
func (*FileLogger) LogAlter ¶
func (l *FileLogger) LogAlter(format string, params ...any)
func (*FileLogger) LogCrit ¶
func (l *FileLogger) LogCrit(format string, params ...any)
func (*FileLogger) LogDebug ¶
func (l *FileLogger) LogDebug(format string, params ...any)
func (*FileLogger) LogEmerg ¶
func (l *FileLogger) LogEmerg(format string, params ...any)
func (*FileLogger) LogError ¶
func (l *FileLogger) LogError(format string, params ...any)
func (*FileLogger) LogInfo ¶
func (l *FileLogger) LogInfo(format string, params ...any)
func (*FileLogger) LogNotice ¶
func (l *FileLogger) LogNotice(format string, params ...any)
func (*FileLogger) LogWarning ¶
func (l *FileLogger) LogWarning(format string, params ...any)
func (*FileLogger) SetOutput ¶
func (l *FileLogger) SetOutput(out io.Writer)
Click to show internal directories.
Click to hide internal directories.