Documentation
¶
Overview ¶
Package logger 负责日志收敛,给日志添加前缀和独立文件输出,以便在本框架被集成之后的日志可读
Index ¶
- Constants
- Variables
- func Caller(skip int) func() string
- func CloseDebug()
- func CloseTrace()
- func Console(level int, s string)
- func Consolef(level int, format string, a ...interface{})
- func Consolefc(level int, format string, callerFn CallerFn, a ...interface{})
- func Debug(v ...interface{})
- func DebugEnable() bool
- func Debugf(format string, a ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, a ...interface{})
- func Important(v ...interface{})
- func Importantf(format string, a ...interface{})
- func Info(v ...interface{})
- func Infof(format string, a ...interface{})
- func IsDebugOpen() bool
- func OpenDebug()
- func OpenTrace()
- func SetLog2Console(b bool)
- func SetLogTrack(enable bool, getter func() string)
- func Trace(v ...interface{})
- func TraceEnable() bool
- func Tracef(format string, a ...interface{})
- func Warning(v ...interface{})
- func Warningf(format string, a ...interface{})
- type CallerFn
- type Color
Constants ¶
View Source
const ( TraceLevel = 6 // 可详细跟踪 DebugLevel = 5 // 可调式 InfoLevel = 4 // 日常使用关键信息 WarningLevel = 3 // 警告级别信息 ErrorLevel = 2 // 错误级别信息 CriticalLevel = 1 // 严重错误 )
日志级别定义
Variables ¶
View Source
var ( // LogLevel 日志级别 // level 总共分5个级别:debug < info< warning< error< critical LogLevel = InfoLevel // ConsoleLevel 控制台打印级别 ConsoleLevel = WarningLevel // ShowError2Console 把错误同步打印到控制台 ShowError2Console = false // Logger 独立日志文件 Logger io.Writer = os.Stdout // EnableLogTrack 开启并发日志染色 EnableLogTrack = false )
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.