Crate async_logging

Source

Macros§

critical
debug
error
info
warning

Enums§

Level

Functions§

get_prefix
init
Initialize the logger with a buffer size. This function spawns a background worker that receives log messages and prints them to the console. The buffer size determines how many messages can be queued before the sender blocks.
log
Log a message with a specific log level. This function sends the log message to the background worker for processing. If the logger is not initialized, it will print the message directly to the console.
shutdown
Shutdown the logger and stop the background worker. This function will drop the sender and close the channel, allowing the background worker to exit. It is important to call this function before the program exits to ensure that all log messages are flushed.