log

package
v0.0.0-...-495eea3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Base   = zap.NewNop()
	Logger = Base.Sugar()
)

Defaults

Functions

func DPanic

func DPanic(args ...interface{})

func DPanicf

func DPanicf(template string, args ...interface{})

func DPanicw

func DPanicw(msg string, keysAndValues ...interface{})

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(template string, args ...interface{})

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(template string, args ...interface{})

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(template string, args ...interface{})

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

func Flush

func Flush()

func Info

func Info(args ...interface{})

func Infof

func Infof(template string, args ...interface{})

func Infow

func Infow(msg string, keysAndValues ...interface{})

func InitLogger

func InitLogger(c *LoggerConfig) error

InitLogger loads a global logger based on a configuration

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(template string, args ...interface{})

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

func Printf

func Printf(template string, args ...interface{})

func Println

func Println(msg string)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(template string, args ...interface{})

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

func With

func With(args ...interface{}) *zap.SugaredLogger

Types

type LoggerConfig

type LoggerConfig struct {
	Level             string `conf:"level"`
	Encoding          string `conf:"encoding"`
	Color             bool   `conf:"color"`
	DevMode           bool   `conf:"dev_mode"`
	DisableCaller     bool   `conf:"disable_caller"`
	DisableStacktrace bool   `conf:"disable_stacktrace"`
}

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}

Wrapper implements various useful log functions with the provided logger to fulfill interfaces.

func NewWrapper

func NewWrapper(logger *zap.Logger, level zapcore.Level) *Wrapper

func (*Wrapper) Printf

func (w *Wrapper) Printf(template string, args ...interface{})

Jump to

Keyboard shortcuts

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