Documentation
¶
Index ¶
- Variables
- func Debug(args ...interface{})
- func Debugf(temp string, args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(args ...interface{})
- func Errorf(temp string, args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(temp string, args ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func Info(args ...interface{})
- func Infof(temp string, args ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func IsFile(path string) bool
- func LevelToZapLevel(level string) zapcore.Level
- func LoadConfig(configPath string, out interface{}) (err error)
- func NewLogger(logLevel, logFile, logtype string, logColor bool) *zap.Logger
- func NewSugarLogger(logLevel, logFile, logType string, logColor bool) *zap.SugaredLogger
- func SetLog(level string, file string)
- func Upgrade(log *zap.Logger)
- func Warn(args ...interface{})
- func Warnf(temp string, args ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var Log *zap.Logger
Functions ¶
func LoadConfig ¶ added in v0.0.13
Load Read config from file.
func NewSugarLogger ¶
func NewSugarLogger(logLevel, logFile, logType string, logColor bool) *zap.SugaredLogger
NewSugarLogger 创建一个sugar
Types ¶
type Logger ¶
type Logger struct {
LogLevel string // 日志级别
LogFile string // 日志文件存放路径,如果为空,则输出到控制台
LogType string // 日志类型,支持 txt 和 json ,默认txt
LogMaxSize int //单位M
LogMaxBackups int // 日志文件保留个数
LogMaxAge int // 单位天
LogCompress bool // 压缩轮转的日志
LogColor bool // 日志级别分颜色
}
Click to show internal directories.
Click to hide internal directories.