logger

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogCustomIfError

func LogCustomIfError(logFunc func(string, ...zapcore.Field), msg string, err error, f ...zapcore.Field)

LogCustomIfError - log with custom lvl only if err!=nil.

func LogIfError

func LogIfError(l *Logger, msg string, err error, f ...zapcore.Field)

LogIfError - log only if err!=nil.

Types

type Config

type Config struct {
	Level    string
	Encoding string
	Color    bool
	Outputs  []string
	Tags     []string
}

Config - logger config.

type Logger

type Logger = zap.Logger

Logger logger wrapper under zap.Logger.

func New

func New(config Config, e, serviceName, version string) (*Logger, error)

New - create new logger.

func NewNop

func NewNop() *Logger

NewNop - new Nop Logger.

Directories

Path Synopsis
nolint golint
nolint golint

Jump to

Keyboard shortcuts

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