flatten logfilter into route

This commit is contained in:
Chris Beck
2025-12-05 23:51:05 -07:00
parent 928a1aba78
commit 4e9704def2
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -241,8 +241,8 @@ impl LogHandler {
continue;
}
// Check if message matches route's filter (if any)
if !route.filter.as_ref().is_none_or(|f| f.matches(log_msg)) {
// Check if message matches route's filter
if !route.filter.matches(log_msg) {
continue;
}
+5 -5
View File
@@ -52,10 +52,10 @@ pub struct Route {
#[serde(default = "default_alert_level")]
pub alert_level: Level,
/// Optional filter to match log messages for this route.
/// If not specified, the route matches all messages.
#[serde(default)]
pub filter: Option<LogFilter>,
/// Filter to match log messages for this route.
/// If all filter fields are empty, the route matches all messages.
#[serde(flatten)]
pub filter: LogFilter,
/// Optional destination override for alerts from this route.
/// If not specified, alerts go to the default admin destination.
@@ -93,7 +93,7 @@ impl Default for Route {
fn default() -> Self {
Self {
alert_level: default_alert_level(),
filter: None,
filter: LogFilter::default(),
destination: None,
limit: Vec::new(),
global_limit: Vec::new(),