Skip to content

Commit

Permalink
update defaults info
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Sep 17, 2024
1 parent dbaf2cf commit acc8f28
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'log-level'
title: 'developer'
language: 'en'
---

Expand All @@ -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).
1 change: 1 addition & 0 deletions docs/docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ language: 'en'

<!-- - Fix: MacOS Delete key doesn't work in kitty mode [#513](https://github.com/raphamorim/rio/issues/513). -->
<!-- - Fix: Kitty keyboard protocol doesn't work with tmux [#599](https://github.com/raphamorim/rio/issues/599). -->
- `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.
Expand Down
2 changes: 1 addition & 1 deletion frontends/rioterm/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions frontends/rioterm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
};

{
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:?}");
}
Expand Down
6 changes: 3 additions & 3 deletions rio-backend/src/config/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ pub fn default_config_file_content() -> String {
#
# "mode" - Define navigation mode
# • NativeTab (MacOS only)
# • CollapsedTab
# • Bookmark
# • BottomTab
# • TopTab
# • Plain
Expand All @@ -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
Expand Down Expand Up @@ -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()
}
6 changes: 3 additions & 3 deletions rio-backend/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down

0 comments on commit acc8f28

Please sign in to comment.