Skip to main content

Module log

Module log 

Source

Structs§

ElasticConfig
Elastic configuration. Required to set up logging to an Elastic cluster. Default without configuration: Log to console
LogMessage

Enums§

Error
LogEnvironment
LogLevel

Functions§

create_console_message
debug
Logs message with ‘debug’ as severity level. This should be used for debug-purposes only. Messages will be ignored if environment is set to production.
error
Logs message with ‘error’ as severity level. This should be used if a critical error that needs too be looked at occurs. The application must be able to recover, and unrelated data-loss should not happen when using this.
fatal
Logs message with ‘fatal’ as severity level. This should be used if an unrecoverable error occurs, that leaves the application with no choice but to shut down.
flush
Closes the sender, and publishes remaining logs before closing the publish loop. You should call this before your application completes/returns so that no logs are lost.
get_matches
information
Logs message with ‘information’ as severity level. Feel free to use this to log any information you may want to inspect. /// # Examples
log
setup_console_log
setup_elastic_log
Sets up the log service. Call this before calling the log:: functions. To prevent loss of logs on application shutdown, make sure call log::flush() before the fact.
warning
Logs message with ‘warning’ as severity level. This should be used if an error or issue occurs that may may have to be looked at, but is unimportant for application logic’s continuous success.