Documentation
¶
Index ¶
- Constants
- func DPanic(args ...interface{})
- func DPanicf(template string, args ...interface{})
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Flush()
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func NewSugar(strFilename string, nMaxSizeMB int, bLocalTime bool, bCompress bool, ...)
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Print(args ...interface{})
- func Printf(template string, args ...interface{})
- func Println(args ...interface{})
- func Since(t time.Time) time.Duration
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
Constants ¶
View Source
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel int8 = iota - 1 // InfoLevel is the default logging priority. InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel // DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. DPanicLevel // PanicLevel logs a message, then panics. PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel )
Variables ¶
This section is empty.
Functions ¶
func NewSugar ¶ added in v1.0.19
func NewSugar(strFilename string, nMaxSizeMB int, bLocalTime bool, bCompress bool, nMaxAge int, strTimeFormat string, nLevel int8)
NewSugar 新建一个糖 usage : NewSugar(autologfilename(), 50, true, true, 60, "2006-01-02 15:04:05.000", DebugLevel) @strFilename 保存的文件名 @nMaxSizeMB 截取的文件大小, 每隔多少MB截取 @bLocalTime 是否使用本地时间 @bCompress 是否压缩 @nMaxAge 文件最多保存多少天 @strTimeFormat 时间格式 @nLevel 日志的保存等级
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.