Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoggerLevel ¶
func GetLowLogLevel ¶
GetLowLogLevel 获取writer中最低日志级别
Types ¶
type ConsoleConfig ¶
type ConsoleConfig struct {
LogLevel string // 日志级别,可选,默认debug
}
ConsoleConfig 用户自定义console配置
type FileConfig ¶
type FileConfig struct { Filename string // 日志文件, 默认"./log/rlog.log",可选 MaxFileSize int // 日志文件单个文件最大大小,单位为MB,默认100,可选 MaxBackups int // 日志文件最大历史保留份数,默认5,可选 MaxAge int // 日志文件最长存活时间,单位为天, 默认30,可选 Compress bool // 历史日志压缩保存,默认false,可选 LogLevel string // 日志级别,默认debug,可选 }
FileConfig 用户自定义File配置
type Writer ¶
type Writer interface { // GetLogLevel 获取日志级别 GetLogLevel() string // Check 日志检查,过滤掉不必要的日志输入 Check(*REntry) bool // Write 日志输出内容 Write([]byte) error }
func NewConsoleWriter ¶
func NewConsoleWriter(opt *ConsoleConfig) Writer
func NewFileWriter ¶
func NewFileWriter(opt *FileConfig) Writer
Click to show internal directories.
Click to hide internal directories.