Documentation
¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func SetLogger(logger Logger)
- func SetLoggerCallerDisable() error
- func SetLoggerLevel(level LoggerLevel) error
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- type Logger
- type LoggerLevel
Constants ¶
View Source
const ( // LoggerLevelDebug DebugLevel logs are typically voluminous, and are usually disabled in // production. LoggerLevelDebug = LoggerLevel(zapcore.DebugLevel) // LoggerLevelInfo InfoLevel is the default logging priority. LoggerLevelInfo = LoggerLevel(zapcore.InfoLevel) // LoggerLevelWarn WarnLevel logs are more important than Infof, but don't need individual // human review. LoggerLevelWarn = LoggerLevel(zapcore.WarnLevel) // LoggerLevelError ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. LoggerLevelError = LoggerLevel(zapcore.ErrorLevel) // LoggerLevelDPanic DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. LoggerLevelDPanic = LoggerLevel(zapcore.DPanicLevel) // LoggerLevelPanic PanicLevel logs a message, then panics. LoggerLevelPanic = LoggerLevel(zapcore.PanicLevel) // LoggerLevelFatal FatalLevel logs a message, then calls os.Exit(1). LoggerLevelFatal = LoggerLevel(zapcore.FatalLevel) )
Variables ¶
This section is empty.
Functions ¶
func SetLoggerCallerDisable ¶
func SetLoggerCallerDisable() error
SetLoggerCallerDisable disable caller info in production env for performance improve. It is highly recommended that you execute this method in a production environment.
Types ¶
type Logger ¶
type Logger interface { Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Debug(args ...interface{}) Infof(fmt string, args ...interface{}) Warnf(fmt string, args ...interface{}) Errorf(fmt string, args ...interface{}) Debugf(fmt string, args ...interface{}) }
Logger for user who want to customize logger of getty
type LoggerLevel ¶
type LoggerLevel int8
Click to show internal directories.
Click to hide internal directories.