logger

package
v0.0.0-...-d2a45df Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug func(msg string, fields ...zap.Field)

Debug - log to debug level

View Source
var Error func(msg string, fields ...zap.Field)

Error - log to error level

View Source
var Fatal func(msg string, fields ...zap.Field)

Fatal - log to Fatal level

View Source
var Info func(msg string, fields ...zap.Field)

Info - log to info level

View Source
var (
	// Log is global logger
	Log *zap.Logger
)
View Source
var LogLevels = map[string]int{
	"debug":  -1,
	"info":   0,
	"warn":   1,
	"error":  2,
	"dpanic": 3,
	"panic":  4,
	"fatal":  5,
}

LogLevels is global log level: Debug(-1), Info(0), Warn(1), Error(2), DPanic(3), Panic(4), Fatal(5)

View Source
var Warn func(msg string, fields ...zap.Field)

Warn - log to warn level

Functions

func Init

func Init(config Config)

func InitLogger

func InitLogger(config Config) *zap.Logger

InitLogger initializes log by input parameters lvl - global log level: Debug(-1), Info(0), Warn(1), Error(2), DPanic(3), Panic(4), Fatal(5)

Types

type Config

type Config struct {
	LogLevel          string
	LogOutputPaths    string
	DisableStackTrace bool
}

Jump to

Keyboard shortcuts

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