Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogInfo = int(zapcore.InfoLevel) LogDebug = int(zapcore.DebugLevel) LogError = int(zapcore.ErrorLevel) LogFatal = int(zapcore.FatalLevel) LogPanic = int(zapcore.PanicLevel) LogWarn = int(zapcore.WarnLevel) )
View Source
const DefaultLevel = LogInfo
DefaultLevel is the default level where statements are logged. Change the value of this variable before init() to change the level of the default logger.
Variables ¶
This section is empty.
Functions ¶
func ConfigureDefaultLogger ¶ added in v1.4.6
func ConfigureDefaultLogger(output zapcore.WriteSyncer, level int, jsonFormat bool)
ConfigureDefaultLogger updates the default logger to wrap a provided kit logger.
func NewZapLogger ¶ added in v1.4.6
Types ¶
type Logger ¶
type Logger interface { Info(keyvals ...interface{}) Debug(keyvals ...interface{}) Warn(keyvals ...interface{}) Error(keyvals ...interface{}) Fatal(keyvals ...interface{}) Panic(keyvals ...interface{}) Infow(msg string, keyvals ...interface{}) Debugw(msg string, keyvals ...interface{}) Warnw(msg string, keyvals ...interface{}) Errorw(msg string, keyvals ...interface{}) Fatalw(msg string, keyvals ...interface{}) Panicw(msg string, keyvals ...interface{}) With(args ...interface{}) Logger Named(s string) Logger AddCallerSkip(skip int) Logger }
Logger is a interface that can log to different levels.
func DefaultLogger ¶
func DefaultLogger() Logger
DefaultLogger is the default logger that only logs at the `DefaultLevel`.
func NewJSONLogger ¶ added in v1.4.6
func NewJSONLogger(output zapcore.WriteSyncer, level int) Logger
NewJSONLogger returns a logger that prints statements at the given level as JSON output.
Click to show internal directories.
Click to hide internal directories.