Documentation ¶
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func SetLogger(logger Logger)
- func SetLoggerCallerDisable() error
- func SetLoggerLevel(level LogLevel) error
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type LogLevel
- type Logger
Constants ¶
View Source
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel = LogLevel(zapcore.DebugLevel) // InfoLevel is the default logging priority. InfoLevel = LogLevel(zapcore.InfoLevel) // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel = LogLevel(zapcore.WarnLevel) // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel = LogLevel(zapcore.ErrorLevel) // PanicLevel logs a message, then panics. PanicLevel = LogLevel(zapcore.PanicLevel) // FatalLevel logs a message, then calls os.Exit(1). FatalLevel = LogLevel(zapcore.FatalLevel) )
Variables ¶
This section is empty.
Functions ¶
func SetLogger ¶ added in v0.1.4
func SetLogger(logger Logger)
SetLogger: customize yourself logger.
func SetLoggerCallerDisable ¶ added in v0.1.4
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 ¶ added in v0.1.4
type Logger interface { Debug(v ...interface{}) Debugf(format string, v ...interface{}) Info(v ...interface{}) Infof(format string, v ...interface{}) Warn(v ...interface{}) Warnf(format string, v ...interface{}) Error(v ...interface{}) Errorf(format string, v ...interface{}) Panic(v ...interface{}) Panicf(format string, v ...interface{}) Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) }
Click to show internal directories.
Click to hide internal directories.