Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(msg string, fields ...zap.Field)
- func Error(msg string, fields ...zap.Field)
- func Fatal(msg string, fields ...zap.Field)
- func Info(msg string, fields ...zap.Field)
- func Panic(msg string, fields ...zap.Field)
- func SetDefaultLogger(logger *SLogger)
- func Sync()
- func Warn(msg string, fields ...zap.Field)
- type MqSink
- type SLogger
- func (self *SLogger) Debug(msg string, fields ...zap.Field)
- func (self *SLogger) Error(msg string, fields ...zap.Field)
- func (self *SLogger) Fatal(msg string, fields ...zap.Field)
- func (self *SLogger) Info(msg string, fields ...zap.Field)
- func (self *SLogger) Panic(msg string, fields ...zap.Field)
- func (self *SLogger) Sync()
- func (self *SLogger) Warn(msg string, fields ...zap.Field)
Constants ¶
View Source
const ( DEF_LOG_FILENAME = "log.log" DEF_LOG_PATH = "./" DEF_LOG_LEVEL = 1 )
Variables ¶
View Source
var ( LogLevelMap = map[int]zapcore.Level{ 1: zapcore.DebugLevel, 2: zapcore.InfoLevel, 3: zapcore.WarnLevel, 4: zapcore.ErrorLevel, 5: zapcore.DPanicLevel, 6: zapcore.PanicLevel, 7: zapcore.FatalLevel, } )
Functions ¶
func SetDefaultLogger ¶
func SetDefaultLogger(logger *SLogger)
Types ¶
type SLogger ¶
type SLogger struct {
// contains filtered or unexported fields
}
/ 默认配置: / json 格式 / 单文件最大 10 m / 最多保留1个月 / 压缩备份
func NewSLogger ¶
@console: 是否输出到 console @path: 路径 @level: 日志等级 @sinks: 日志额外的输出
Click to show internal directories.
Click to hide internal directories.