Skip to content

Commit

Permalink
dump all exclude config
Browse files Browse the repository at this point in the history
  • Loading branch information
bomgar committed Sep 26, 2024
1 parent 4fa57a3 commit aff5326
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions default_config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
message_keys = ["short_message", "msg", "message"]
time_keys = ["timestamp", "time", "@timestamp"]
dump_all_exclude = []
level_keys = ["level", "severity", "log.level", "loglevel"]
main_line_format = "{{bold(fixed_size 19 fblog_timestamp)}} {{level_style (uppercase (fixed_size 5 fblog_level))}}:{{#if fblog_prefix}} {{bold(cyan fblog_prefix)}}{{/if}} {{fblog_message}}"
additional_value_format = "{{bold (color_rgb 150 150 150 (fixed_size 25 key))}}: {{value}}"
Expand Down
7 changes: 7 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ fn default_message_keys() -> Vec<String> {
fn default_time_keys() -> Vec<String> {
vec!["timestamp".to_string(), "time".to_string(), "@timestamp".to_string()]
}
fn default_dump_all_exclude() -> Vec<String> {
vec![]
}

fn default_level_keys() -> Vec<String> {
vec!["level".to_string(), "severity".to_string(), "log.level".to_string(), "loglevel".to_string()]
Expand All @@ -37,6 +40,9 @@ pub struct Config {
#[serde(default = "default_time_keys")]
pub time_keys: Vec<String>,

#[serde(default = "default_dump_all_exclude")]
pub dump_all_exclude: Vec<String>,

#[serde(default = "default_level_keys")]
pub level_keys: Vec<String>,

Expand Down Expand Up @@ -80,6 +86,7 @@ impl Config {
level_map: default_level_map(),
main_line_format: default_main_line_format(),
additional_value_format: default_additional_value_format(),
dump_all_exclude: default_dump_all_exclude(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/log_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl LogSettings {
level_keys: config.level_keys.clone(),
level_map: config.level_map.clone(),
additional_values: vec![],
excluded_values: vec![],
excluded_values: config.dump_all_exclude.clone(),
dump_all: false,
with_prefix: false,
print_lua: false,
Expand Down

0 comments on commit aff5326

Please sign in to comment.