logger

package
v0.0.0-...-0631483 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Development = "development"
	Production  = "production"
)

Variables

View Source
var LevelNamesMap = map[string]zapcore.Level{
	"debug":  zapcore.DebugLevel,
	"info":   zapcore.InfoLevel,
	"warn":   zapcore.WarnLevel,
	"error":  zapcore.ErrorLevel,
	"dpanic": zapcore.DPanicLevel,
	"panic":  zapcore.PanicLevel,
	"fatal":  zapcore.FatalLevel,
}

LevelNamesMap stores mapping from string loglevel to zapcore.Level

Functions

func NewDevelopmentSugarLogger

func NewDevelopmentSugarLogger(pathsToLogs []string) (*zap.SugaredLogger, error)

NewDevelopmentSugarLogger creates new zap.SugaredLogger to use it during development

func NewEnvironmentSugarLogger

func NewEnvironmentSugarLogger(environment string, pathsToLogs []string) (*zap.SugaredLogger, error)

NewEnvironmentSugarLogger creates new zap.SugaredLogger for environment

func NewLogger

func NewLogger(logLevel string, pathsToLogs []string, encoding string) (*zap.Logger, error)

NewLogger creates new zap.Logger if pathToLogs is empty, stdout will be used

func NewProductionSugarLogger

func NewProductionSugarLogger(pathsToLogs []string) (*zap.SugaredLogger, error)

NewProductionSugarLogger creates new zap.SugaredLogger to use it in production

func NewSugarLogger

func NewSugarLogger(logLevel string, pathsToLogs []string, encoding string) (*zap.SugaredLogger, error)

NewSugarLogger creates new zap.SugaredLogger

Types

This section is empty.

Jump to

Keyboard shortcuts

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