Documentation
¶
Overview ¶
Package logging allows for configuration of the API's logging levels.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶
func SetLogLevel(level LogLevel)
SetLogLevel sets the global logging-level used for API logging.
func SetLogOutput ¶
SetLogOutput sets the global logging output redirection for API logging. The specified writer should be safe for concurrent writes.
Types ¶
type LogLevel ¶
type LogLevel byte
LogLevel is used to configure the logging-level of the API. The different levels can include these type logs:
- Critical/Error - These log levels indicates internal errors and should be a cause for investigation. Contact Solace for log events at this level.
- Warning - Indicates an application error (for example, invalid parameters passed in or unsupported use of the APIs).
- Info - Typically for unusual or informational occurrences that do not indicate an error, but might be unexpected or provide information useful for indicating a state.
- Debug - Typically indicates state changes at a high-level, for example, connections/disconnections/reconnections These logs can indicate unusual occurrences that do not indicate any error, but they are unexpected and might need further investigation.
const ( // LogLevelCritical allows only critical logs. // Critical logs are only output if a catastrophic unrecoverable error occurs. LogLevelCritical LogLevel = LogLevel(logging.Critical) // LogLevelError allows Error and Critical logs. // Error logs are only output if unexpected behaviour is detected. LogLevelError LogLevel = LogLevel(logging.Error) // LogLevelWarning allows Warning, Error, and Critical logs. // Warning logs are output if an issue is encountered due to application behavior. LogLevelWarning LogLevel = LogLevel(logging.Warning) // LogLevelInfo allows Info, Warning, Error, and Critical logs. // Info logs are output when general API activities occur. LogLevelInfo LogLevel = LogLevel(logging.Info) // LogLevelDebug allows Debug, Info, Warning, Error, and Critical logs. // Debug logs are output when any API activity occurs. Note that // enabling Debug logs impacts the performance of the API. LogLevelDebug LogLevel = LogLevel(logging.Debug) )