diff options
author | Griffin Smith <root@gws.fyi> | 2019-07-09T00·58-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-07-09T00·58-0400 |
commit | 5af2429ecb5742383cf0798ce23682d316bdb24d (patch) | |
tree | 0fba959d9a5bce5c749c8529b3f2ea7b557c5767 /src/settings.rs | |
parent | 20f1ccb4600b88ac01768e912e6d5837534ca852 (diff) |
Implement a global map of entities
Implement a global map of entities, which allows referencing by either position or ID and updating the positions of existent entities, and put the character in there.
Diffstat (limited to 'src/settings.rs')
-rw-r--r-- | src/settings.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/settings.rs b/src/settings.rs index 8444bf80eec8..1f205814d1dd 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -4,13 +4,16 @@ use log4rs::append::file::FileAppender; use log4rs::config::{Appender, Root}; use log4rs::encode::pattern::PatternEncoder; -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct Logging { #[serde(default = "Logging::default_level")] pub level: LevelFilter, #[serde(default = "Logging::default_file")] pub file: String, + + #[serde(default = "Logging::default_print_backtrace")] + pub print_backtrace: bool, } impl Default for Logging { @@ -18,6 +21,7 @@ impl Default for Logging { Logging { level: LevelFilter::Off, file: "debug.log".to_string(), + print_backtrace: true, } } } @@ -44,9 +48,13 @@ impl Logging { fn default_file() -> String { Logging::default().file } + + fn default_print_backtrace() -> bool { + Logging::default().print_backtrace + } } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct Settings { pub seed: Option<u64>, pub logging: Logging, |