bin_common
A library for common things in binaries. Mainly useful for a quick logging setup with support for logging to files, logging panics and log rotation.
Usage
This is an example for how to use this library.
let crate_setup = new
.with_app_name // set app name for paths
.build
.unwrap;
crate_setup
.logging_setup
.with_verbosity // log only INFO and above messages
.with_log_to_file // write all log messages to file and stdout
.with_log_panics // log panics
.with_log_rotation // rotate log files
.build
.unwrap;
info;
The CrateSetup
stores the application name and resulting base directories according to the XDG directory spec and allows setting up logging.