v1.5.7 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: Apache-2.0, MIT Imports: 4 Imported by: 12




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.


This section is empty.


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

func NewZapLogger(output zapcore.WriteSyncer, encoder zapcore.Encoder, level int) *zap.Logger


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.

func NewLogger

func NewLogger(output zapcore.WriteSyncer, level int) Logger

NewLogger returns a logger that prints statements at the given level.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL