logger

package
v0.0.0-...-cb424ea Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableColor

func DisableColor(flag bool)

func InitDefaultLogger

func InitDefaultLogger()

func InitLogger

func InitLogger(loggerName string)
InitLogger initialize desired logger

Use: InitLogger("<logger name>")

Supported logger names (call ListLoggersNames() for listing supported loggers) - "zap": Logger from package "go.uber.org/zap" - "pretty", "colorful": Human friendly colorful logger - "none", "mock", "empty", "ignore": Logger will not print anything

Default: - "pretty"

e.g. InitLogger("none") -> will initialize the mock logger

func ListLoggersNames

func ListLoggersNames() []string

Types

type ILogger

type ILogger interface {
	Fatal(msg string, details ...helpers.IDetails) // print log and exit 1
	Error(msg string, details ...helpers.IDetails)
	Success(msg string, details ...helpers.IDetails)
	Warning(msg string, details ...helpers.IDetails)
	Info(msg string, details ...helpers.IDetails)
	Debug(msg string, details ...helpers.IDetails)

	SetLevel(level string) error
	GetLevel() string

	SetWriter(w *os.File)
	GetWriter() *os.File

	LoggerName() string
}

func L

func L() ILogger

Return initialized logger. If logger not initialized, will call InitializeLogger() with the default value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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