Logging #26

Open
leon wants to merge 33 commits from Logging into main
Showing only changes of commit d8b7616c43 - Show all commits

View File

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