Documentation ¶
Index ¶
- func DefaultLevel() string
- func GetModuleLevel(module string) string
- func GetPeerStartupLevel(module string) string
- func InitBackend(formatter logging.Formatter, output io.Writer)
- func InitFromSpec(spec string) string
- func InitLogConfig(conf *Config)
- func InitRollingBackend(logfile string, maxSize int, maxBackups int, maxAge int)
- func MustGetLogger(module string) *logging.Logger
- func Reset()
- func RevertToPeerStartupLevels() error
- func SetFormat(formatSpec string) logging.Formatter
- func SetModuleLevel(moduleRegExp string, level string) (string, error)
- func SetPeerStartupModulesMap()
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLevel ¶
func DefaultLevel() string
DefaultLevel returns the fallback value for loggers to use if parsing fails.
func GetModuleLevel ¶
GetModuleLevel gets the current logging level for the specified module.
func GetPeerStartupLevel ¶
GetPeerStartupLevel returns the peer startup level for the specified module. It will return an empty string if the input parameter is empty or the module is not found
func InitBackend ¶
InitBackend sets up the logging backend based on the provided logging formatter and I/O writer.
func InitFromSpec ¶
InitFromSpec initializes the logging based on the supplied spec. It is exposed externally so that consumers of the blogging package may parse their own logging specification. The logging specification has the following form:
[<module>[,<module>...]=]<level>[:[<module>[,<module>...]=]<level>...]
func InitLogConfig ¶
func InitLogConfig(conf *Config)
InitLogConfig Set the logging level with common ServerGeneral configurations
func InitRollingBackend ¶
InitRollingBackend set rolling log backend maxSize is the maximum size in megabytes maxBackups is the maximum number of old log files to retain maxAge is the maximum number of days to retain old log files
func MustGetLogger ¶
func MustGetLogger(module string) *logging.Logger
MustGetLogger is used in place of `logging.MustGetLogger` to allow us to store a map of all modules and submodules that have loggers in the system.
func RevertToPeerStartupLevels ¶
func RevertToPeerStartupLevels() error
RevertToPeerStartupLevels reverts the log levels for all modules to the level defined at the end of peer startup.
func SetFormat ¶
func SetFormat(formatSpec string) logging.Formatter
SetFormat sets the logging format.
func SetModuleLevel ¶
SetModuleLevel sets the logging level for the modules that match the supplied regular expression. Can be used to dynamically change the log level for the module.
func SetPeerStartupModulesMap ¶
func SetPeerStartupModulesMap()
SetPeerStartupModulesMap saves the modules and their log levels. this function should only be called at the end of peer startup.