Logging #26
@ -16,9 +16,9 @@ use getset::Setters;
|
||||
* Represents a valid `WANessa` configuration. Intended as a read-only singleton.
|
||||
* See [`DEFAULTS`]
|
||||
*/
|
||||
#[derive(Clone, PartialEq, Eq, Getters, Setters)]
|
||||
#[derive(Clone, PartialEq, Eq, Getters, Setters, Debug)]
|
||||
#[getset(get = "pub", set = "pub")]
|
||||
#[allow(clippy::struct_excessive_bools)] // False positive, since it is a config struct.
|
||||
#[allow(clippy::struct_excessive_bools)] // False positive, since this is a config struct.
|
||||
pub struct Config {
|
||||
/// See [`LogVerbosity`].<br>
|
||||
/// Default: [`Warning`]
|
||||
@ -92,19 +92,19 @@ impl Default for Config {
|
||||
* ```rust
|
||||
* # use config::Config;
|
||||
* # use config::LogVerbosity::Warning;
|
||||
* let DEFAULTS = Config
|
||||
* {
|
||||
* log_verbosity: Warning,
|
||||
* log_time: false,
|
||||
* log_time_format: None,
|
||||
* log_location: false,
|
||||
* log_stdout: true,
|
||||
* log_stderr: true,
|
||||
* log_path: None,
|
||||
* db_addr: None,
|
||||
* db_port: 6969,
|
||||
* };
|
||||
* # assert!(DEFAULTS == config::DEFAULTS)
|
||||
* let mut defaults = Config::default();
|
||||
*
|
||||
* defaults.set_log_verbosity(Warning);
|
||||
* defaults.set_log_time(false);
|
||||
* //defaults.set_log_time_format(None);
|
||||
* defaults.set_log_location(false);
|
||||
* defaults.set_log_stdout(true);
|
||||
* defaults.set_log_stderr(true);
|
||||
* //defaults.set_log_path(None);
|
||||
* //defaults.set_db_addr(None);
|
||||
* defaults.set_db_port(6969);
|
||||
*
|
||||
* # assert!(defaults == config::DEFAULTS)
|
||||
* ```
|
||||
*/
|
||||
pub const DEFAULTS: Config = Config {
|
||||
|
Reference in New Issue
Block a user