Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DebugLogger *log.Logger InfoLogger *log.Logger WarnLogger *log.Logger ErrorLogger *log.Logger FatalLogger *log.Logger // Suppress output by default when tests are being run IsTesting bool )
Several of these vars are exported intentionally, so callers can access & override values during their tests or runtimes. For example, a caller whose functions call FatalLog() in the call stack may want to be able to disable IsTesting to emit logs, redirect log output to a buffer, and match against that output (e.g. rhad has tests like this)
Functions ¶
func Fatal ¶ added in v0.6.0
Fatal prints fatal log messages, which includes an exit call. There is no check here for if external tests are being run, so that callers can still see fatal log messages.
func SetLoggerPrefixName ¶
func SetLoggerPrefixName(name string)
SetLoggerPrefixName is used to construct the custom part of the log prefix of the loggers. It is called as part of the init() call in this package and given a default value, but callers can override this value with a different string value, typically the calling application's name (e.g. "rhad")
Types ¶
This section is empty.