Documentation
¶
Index ¶
- Constants
- func AppendFileLog(filename, format string, a ...interface{}) error
- func CreateZapCore(c *Config) zapcore.Core
- func DPanic(args ...interface{})
- func DPanicf(format string, args ...interface{})
- func DPanicln(args ...interface{})
- func DPanicw(msg string, kvPairs ...interface{})
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Debugw(msg string, kvPairs ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Errorw(msg string, kvPairs ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Fatalw(msg string, kvPairs ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Infow(msg string, kvPairs ...interface{})
- func IsTerminal(w io.Writer) bool
- func Level() zapcore.Level
- func Logger() *zap.Logger
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicln(args ...interface{})
- func Panicw(msg string, kvPairs ...interface{})
- func SetLogger(log *zap.Logger)
- func SetLoggerWith(core zapcore.Core, callerSkip int)
- func Sugared() *zap.SugaredLogger
- func Sync() error
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- func Warnw(msg string, kvPairs ...interface{})
- func With(fields ...zap.Field) *zap.Logger
- type Config
- type Writer
Constants ¶
View Source
const LayoutISO8601 = "2006-01-02T15:04:05.000Z0700"
Variables ¶
This section is empty.
Functions ¶
func AppendFileLog ¶
AppendFileLog append log to file
func IsTerminal ¶
func SetLoggerWith ¶
func Sugared ¶
func Sugared() *zap.SugaredLogger
Types ¶
type Config ¶
type Config struct { Level string `json:"level"` // DEBUG, INFO, WARN, PANIC, FATAL Encoding string `json:"encoding"` // "json" or "console" TimeLayout string `json:"time-layout"` // layout to encoding time Filename string `json:"filename"` // MaxSize int `json:"max_size"` // defaults to 100 MB MaxBackups int `json:"max_backups"` // maximum number of old log files to retain CallerSkip int `json:"caller_skip"` // skip some number of extra stack frames (0 = don't skip) }
Config 配置参数
Click to show internal directories.
Click to hide internal directories.