clap-logflag
[work in progress]
The clap-logflag library adds a --log flag to clap based applications
that allows CLI users to configure logging from the command line.
It can log to stderr, files and syslog.
Examples
# Log to a single destination
# Log to both stderr and a file
# Filter log levels
# Disable logging
# Use default logging setup (defined by the application developer)
Setup
To use clap-logflag, first add clap-logflag, clap and log to your Cargo.toml.
Then, add the LogArgs struct to your clap definition and initialize logging with it:
use Parser;
use LoggingConfig;
use LevelFilter;
Syntax
See LogArgs for a detailed explanation of the syntax for the --log argument.
License: MIT OR Apache-2.0