ilog

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var X = func() zerolog.Logger {
	l := func() zerolog.Level {
		if cast.ToBool(os.Getenv("DEBUG")) || (constant.PREFIX != "" && cast.ToBool(os.Getenv(constant.PREFIX+"_DEBUG"))) {
			return zerolog.DebugLevel
		}
		for i, a := range os.Args {
			if a == "--debug" && (i+1 >= len(os.Args) || (i+1 < len(os.Args) && cast.ToBool(os.Args[i+1]))) {
				return zerolog.DebugLevel
			}
		}
		return zerolog.InfoLevel
	}()
	lc := zerolog.New(&zerolog.ConsoleWriter{Out: colorable.NewColorableStdout(), TimeFormat: constant.LoggerTimeFormat}).Level(l).With()
	if constant.VERSION != "" {
		lc = lc.Str("version", constant.VERSION)
	}
	return lc.Timestamp().Logger()
}()

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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