Documentation
¶
Index ¶
- Variables
- func CoreLogger() *zap.Logger
- func Debug(msg string, fields ...Field)
- func Debugf(format string, args ...interface{})
- func Error(msg string, fields ...Field)
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(msg string, fields ...Field)
- func Infof(format string, args ...interface{})
- func IsDebug() bool
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func SetDebug()
- func SetLevel(lvl zapcore.Level)
- func Sync()
- func Warn(msg string, fields ...Field)
- func Warnf(format string, args ...interface{})
- type Config
- type Field
- type Level
- type Logger
- type SugaredLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DebugLevel = zapcore.DebugLevel InfoLevel = zapcore.InfoLevel WarnLevel = zapcore.WarnLevel ErrorLevel = zapcore.ErrorLevel PanicLevel = zapcore.PanicLevel FatalLevel = zapcore.FatalLevel )
Functions ¶
func CoreLogger ¶
Types ¶
type Config ¶
type Config struct { Level string // Encoding sets the logger's encoding. Valid values are "json" and // "console", as well as any third-party encodings registered via // RegisterEncoder. Encoding string // DisableCaller configures the Logger to annotate each message with the filename // and line number of zap's caller, or not DisableCaller bool // OutputPaths is a list of URLs or file paths to write logging output to. // See Open for details. OutputPaths []string // ErrorOutputPaths is a list of URLs to write internal logger errors to. // The default is standard error. // // Note that this setting only affects internal errors; for sample code that // sends error-level logs to a different location from info- and debug-level // logs, see the package-level AdvancedConfiguration example. ErrorOutputPaths []string }
type Field ¶
Field is an alias of zap.Field. Aliasing this type dramatically improves the navigability of this package's API documentation.
type Logger ¶
type Logger interface { Named(s string) Logger With(fields ...Field) Logger Debug(msg string, fields ...Field) Info(msg string, fields ...Field) Warn(msg string, fields ...Field) Error(msg string, fields ...Field) Clone() Logger Level() string IsDebug() bool Sync() SugaredLogger() SugaredLogger CoreLogger() *zap.Logger }
Logger defines methods of writing log
func DefaultLogger ¶
func DefaultLogger() Logger
type SugaredLogger ¶
type SugaredLogger interface { Named(name string) SugaredLogger With(args ...interface{}) SugaredLogger Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Panic(args ...interface{}) Fatal(args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Panicf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Sync() }
func DefaultSugaredLogger ¶
func DefaultSugaredLogger() SugaredLogger
func GetSugaredLogger ¶
func GetSugaredLogger() SugaredLogger
Click to show internal directories.
Click to hide internal directories.