Expand description
This crate provides a wrapper over log
crate that allows you
to specify the type of messages and automatically suppress
types of messages that are overwhelmingly sent.
Basic usage:
clilog::info!(I01TEST, "test message");
when message tagged I01TEST
is sent over 20 times, a tip will be
printed and further such messages will be suppressed.
At the end, you can optionally print a statistics of how many messages are suppressed. (TODO: not implemented yet.)
Re-exports
Macros
Makes an existing timer output an ‘executing’ mesasge. Can be called multiple times.
Makes an existing timer output a ‘finished’ mesasge and suppresses the normal drop message. Only the first call has any effect, subsequent calls will be ignored.
general logging macro that can either log normally, or
check the count before logging.
this is the basis of other macros like info
, warn
, etc.
Creates a timer that logs a starting mesage and a finished message.
Creates a timer that does not log a starting message, only a finished one.
Structs
When this struct is dropped, it logs a message stating its name and how long the execution time was. Can be used to time functions or other critical areas.
Enums
An enum representing the available verbosity levels of the logger.
Constants
Functions
convenient shortcut that you can call in your main()
to initialize logging with stderr color output.
get and increment by 1 the number of occurrence for a specific kind of message. this is not intended to be used separately, but is expected to be called from our macro expansion.