Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogRotator ¶
func InitLogRotator(logFile string)
InitLogRotator initializes the logging rotater to write logs to logFile and create roll files in the same directory. It must be called before the package-global log rotater variables are used.
func NewSubsystem ¶
NewSubsystem registers and returns a new subsystem logger.
func SetLogLevel ¶
SetLogLevel sets the logging level for provided subsystem. Invalid subsystems are ignored. Uninitialized subsystems are dynamically created as needed.
func SetLogLevels ¶
func SetLogLevels(logLevel string)
SetLogLevels sets the log level for all subsystem loggers to the passed level. It also dynamically creates the subsystem loggers as needed, so it can be used to initialize the logging system.
func SupportedSubsystems ¶
func SupportedSubsystems() []string
SupportedSubsystems returns a sorted slice of the supported subsystems for logging purposes.
Types ¶
type LogClosure ¶
type LogClosure func() string
LogClosure is a closure that can be printed with %v to be used to generate expensive-to-create data for a detailed log level and avoid doing the work if the data isn't printed.
func NewLogClosure ¶
func NewLogClosure(c func() string) LogClosure
NewLogClosure returns a new LogClosure.
func (LogClosure) String ¶
func (c LogClosure) String() string