Documentation
¶
Index ¶
- Variables
- func Alert(f any, v ...any)
- func Debug(f any, v ...any)
- func DelOutput(name string)
- func Error(f any, v ...any)
- func Fatal(f any, v ...any)
- func FileNameFormatter() (name, backup string, expire int64)
- func Format(format any, args ...any) (text string)
- func Panic(f any, v ...any)
- func SetCallDepth(depth int)
- func SetFilePathFormatter(f filePathFormatter)
- func SetLevel(level Level)
- func SetOutput(name string, output Output) error
- func Sprint(level Level, content string, stack ...string)
- func Trace(f any, v ...any)
- func Write(msg *Message, stack ...string)
- type Conn
- type File
- type Level
- type Logger
- func (this *Logger) Alert(format interface{}, args ...interface{})
- func (this *Logger) Debug(format interface{}, args ...interface{})
- func (this *Logger) DelOutput(name string)
- func (this *Logger) Error(format interface{}, args ...interface{})
- func (this *Logger) Fatal(format any, args ...any)
- func (this *Logger) Panic(format any, args ...any)
- func (this *Logger) SetCallDepth(depth int)
- func (this *Logger) SetFilePathFormatter(f filePathFormatter)
- func (this *Logger) SetLevel(level Level)
- func (this *Logger) SetOutput(name string, output Output) error
- func (this *Logger) Sprint(level Level, content string, stack ...string)
- func (this *Logger) Trace(format interface{}, args ...interface{})
- func (this *Logger) Write(msg *Message, stack ...string)
- type Message
- type Output
Constants ¶
This section is empty.
Variables ¶
View Source
var Console = &console{colorful: true}
Functions ¶
func FileNameFormatter ¶ added in v0.1.1
FileNameFormatter 默认日志文件,每日一份
func SetCallDepth ¶ added in v0.0.2
func SetCallDepth(depth int)
func SetFilePathFormatter ¶ added in v0.1.2
func SetFilePathFormatter(f filePathFormatter)
SetFilePathFormatter 设置日志起始路径
Types ¶
type Conn ¶ added in v0.0.2
type File ¶ added in v0.0.2
type File struct {
Sprintf func(*Message) *strings.Builder //格式化message
// contains filtered or unexported fields
}
func (*File) GetFileName ¶ added in v0.0.3
func (*File) SetFileName ¶ added in v0.0.3
func (this *File) SetFileName(f fileNameFormatter)
SetFileName 设置日志文件名, 前缀(string) 或者 fileNameFormatter
func (*File) SetFileSize ¶ added in v0.1.0
SetFileSize 设置文件大小(M),默认无限制
type Level ¶ added in v0.0.2
type Level int8
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Debug ¶
func (this *Logger) Debug(format interface{}, args ...interface{})
Debug Log DEBUG level message.
func (*Logger) Error ¶
func (this *Logger) Error(format interface{}, args ...interface{})
Error Log ERROR level message.
func (*Logger) SetCallDepth ¶
func (*Logger) SetFilePathFormatter ¶ added in v0.1.2
func (this *Logger) SetFilePathFormatter(f filePathFormatter)
SetFilePathFormatter 设置日志起始路径
Click to show internal directories.
Click to hide internal directories.