Documentation
¶
Overview ¶
Package lgr An instance of library logger, used for direct output from the command line, etc.
To change logger level shou use the system environment "UYMAS_LGR_LEVEL", like:
//window powershell $env:UYMAS_LGR_LEVEL='all' // linux shell export UYMAS_LGR_LEVEL=all
if not info by default.
Index ¶
- Constants
- func Debug(message string, args ...any)
- func Error(message string, args ...any)
- func ErrorIf(err error, prefixErr ...error)
- func Fatal(message string, args ...any)
- func FatalIf(err error, prefixErr ...error)
- func Info(message string, args ...any)
- func Log() logger.Logger
- func Pref(logPref string) logger.Logger
- func SetFlag(flag int)
- func TmpMark(mark any, args ...any)
- func Trace(message string, args ...any)
- func Warn(message string, args ...any)
Examples ¶
Constants ¶
View Source
const ( // EnvLevelKey try set the lgr level by system environment, like `$ export EnvLevelKey=info` EnvLevelKey = "UYMAS_LGR_LEVEL" // EnvMarkKey try set the lgr mark by system environment, like `$ export EnvMarkKey=mark` EnvMarkKey = "UYMAS_TMP_MARK" )
Variables ¶
This section is empty.
Functions ¶
func ErrorIf ¶
ErrorIf print error message only when err is not nil
func TmpMark ¶
TmpMark temporary tags are used for debugging, and debugging should be removed before release
to global search keyword `lgr.TmpMark` then remove it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.