[−][src]Trait clappconfig::AppConfig
Implement this for the main config struct
Associated Types
type Init
Required methods
fn logging(&self) -> &str
Get log level
fn configure<'a>(self, _clap: &ArgMatches<'a>) -> Result<Self::Init>
Configure the config object using args. Logging has already been inited and configured.
Provided methods
fn print_banner(name: &str, version: &str)
Print startup banner. May be overridden to customize or disable it.
fn pre_log_println(message: String)
Log messages printed before logging is set up May be overridden to customize or disable it.
fn logging_suppress_mods(&self) -> Option<Vec<&str>>
Get names of library modules to suppress from log output (limit to warn or error)
fn logging_mod_levels(&self) -> Option<&HashMap<String, String>>
Get log module levels to use (take priority over the main log level)
fn add_args<'a: 'b, 'b>(clap: App<'a, 'b>) -> App<'a, 'b>
Add args to later use in the configure
method.
fn on_config_file_found(&mut self, _path: &PathBuf)
Called when the config file is resolved, e.g. to store it in Config for later relative path resolution
fn init(name: &str, cfg_file_name: &str, version: &str) -> Result<Self::Init>
Initialize the app
Use env!("CARGO_PKG_VERSION")
to get a version string from Cargo.toml