From acc8f2873b8f4e2a43a0b243185be82f1166c086 Mon Sep 17 00:00:00 2001 From: Raphael Amorim Date: Tue, 17 Sep 2024 09:35:20 +0200 Subject: [PATCH] update defaults info --- docs/docs/config/{log-level.md => developer.md} | 4 ++-- docs/docs/releases.md | 1 + frontends/rioterm/src/cli.rs | 2 +- frontends/rioterm/src/main.rs | 4 ++-- rio-backend/src/config/defaults.rs | 6 +++--- rio-backend/src/config/mod.rs | 6 +++--- 6 files changed, 12 insertions(+), 11 deletions(-) rename docs/docs/config/{log-level.md => developer.md} (88%) diff --git a/docs/docs/config/log-level.md b/docs/docs/config/developer.md similarity index 88% rename from docs/docs/config/log-level.md rename to docs/docs/config/developer.md index 515e0f199a..3b94839521 100644 --- a/docs/docs/config/log-level.md +++ b/docs/docs/config/developer.md @@ -1,5 +1,5 @@ --- -title: 'log-level' +title: 'developer' language: 'en' --- @@ -8,7 +8,7 @@ This property enables log level filter and file. The default level is "OFF" and ```toml [developer] log-level = "OFF" -log-file = false +enable-log-file = false ``` If you have any suggestion of configuration ideas to Rio, please feel free to [open an issue](https://github.com/raphamorim/rio/issues/new). diff --git a/docs/docs/releases.md b/docs/docs/releases.md index de189d908e..232821570a 100644 --- a/docs/docs/releases.md +++ b/docs/docs/releases.md @@ -9,6 +9,7 @@ language: 'en' +- `developer.log-file` has been renamed to `developer.enable-log-file`. - **breaking**: `CollapsedTab` has been renamed to `Bookmark`. - Memory usage reduced by 75% (avg ~201mb to 48mb on first screen render). - Implemented font data deallocator. diff --git a/frontends/rioterm/src/cli.rs b/frontends/rioterm/src/cli.rs index cc08c83221..35962a4faa 100644 --- a/frontends/rioterm/src/cli.rs +++ b/frontends/rioterm/src/cli.rs @@ -37,7 +37,7 @@ pub struct TerminalOptions { /// Writes the logs to a file inside the config directory. #[clap(long)] - pub log_file: bool, + pub enable_log_file: bool, } impl TerminalOptions { diff --git a/frontends/rioterm/src/main.rs b/frontends/rioterm/src/main.rs index 9c36a74e90..23d71a16c4 100644 --- a/frontends/rioterm/src/main.rs +++ b/frontends/rioterm/src/main.rs @@ -152,10 +152,10 @@ fn main() -> Result<(), Box> { }; { - let log_to_file = args.window_options.terminal_options.log_file; + let log_to_file = args.window_options.terminal_options.enable_log_file; if let Err(e) = setup_logs_by_filter_level( &config.developer.log_level, - log_to_file || config.developer.log_file, + log_to_file || config.developer.enable_log_file, ) { eprintln!("unable to configure the logger: {e:?}"); } diff --git a/rio-backend/src/config/defaults.rs b/rio-backend/src/config/defaults.rs index af798f6d2b..439fa71309 100644 --- a/rio-backend/src/config/defaults.rs +++ b/rio-backend/src/config/defaults.rs @@ -358,7 +358,7 @@ pub fn default_config_file_content() -> String { # # "mode" - Define navigation mode # • NativeTab (MacOS only) -# • CollapsedTab +# • Bookmark # • BottomTab # • TopTab # • Plain @@ -370,7 +370,7 @@ pub fn default_config_file_content() -> String { # # Example: # [navigation] -# mode = "collapsedtab" +# mode = "bookmark" # clickable = false # hide-if-single = true # use-current-path = false @@ -447,6 +447,6 @@ pub fn default_config_file_content() -> String { # Example: # [developer] # log-level = "OFF" -# # log-file = "rio.log" +# enable-log-file = false "#.to_string() } diff --git a/rio-backend/src/config/mod.rs b/rio-backend/src/config/mod.rs index 1e4a498160..1d8eed275c 100644 --- a/rio-backend/src/config/mod.rs +++ b/rio-backend/src/config/mod.rs @@ -57,15 +57,15 @@ pub struct Developer { pub enable_fps_counter: bool, #[serde(default = "default_log_level", rename = "log-level")] pub log_level: String, - #[serde(rename = "log-file", default)] - pub log_file: bool, + #[serde(rename = "enable-log-file", default)] + pub enable_log_file: bool, } impl Default for Developer { fn default() -> Developer { Developer { log_level: default_log_level(), - log_file: false, + enable_log_file: false, enable_fps_counter: false, } }