Clout is a command line output library.
It provides a similar interface to the logging crate but with a different focus:
- clout's output is opinionated and not pluggable like logging
- clout provides output with sensible settings for use in command line tools
- colours are supported for different message levels
- output is always to stdout (for now)
- different output levels are selected using settings aligned with typical command line argument conventions
Many libraries already output messages to the logging framework, and you generally don't want all these messages to get displayed to the end user. Clout allows you to generate output using a logging-style API without having to filter all these messages. (In fact you can use clout and logging together eg. by sending the logging messages to a file)
clout includes an additional level between
Status - this is intended
for most output messages.
This is because typically CLI tools provide 3 levels of verbosity (
a common practice) but logging only provides two levels below info.
Emit a debug message
Emit an error message
Emit an info message
Emit a status message
Emit a trace message
Emit a warning message
Builder to configuring clout
Possible errors returned by clout
The different levels of importance of a message Also used to determine what level of messages should be displayed
Determine if clout should use colors for output
Emit a message with a given level and format_args. Prefer the specific macros.
Construct a new Builder.
Shutdown clout. Not strictly necessary, but frees memory.