Skip to content

Commit

Permalink
Show more useful info in "Match:" log
Browse files Browse the repository at this point in the history
Helps figure out when params don't match any input expression values
  • Loading branch information
yoyobuae authored and galister committed Sep 20, 2024
1 parent 43d72cc commit 8f1d3c1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/ext_tracking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ use super::{
AppState,
};

use strum::IntoEnumIterator;
use strum::EnumCount;

#[cfg(feature = "alvr")]
mod alvr;
#[cfg(feature = "babble")]
Expand Down Expand Up @@ -190,7 +193,11 @@ impl ExtTracking {
.or_else(|_| SRanipalExpression::from_str(&main).map(|e| e as usize))
.ok()?;

log::debug!("Match: {}", name);
log::debug!("Match: {}",
UnifiedExpressions::iter().nth(idx)
.map(|e| format!("UnifiedExpressions::{:?}", e))
.or_else(|| CombinedExpression::iter().nth(idx-UnifiedExpressions::COUNT).map(|e| format!("CombinedExpression::{:?}", e)))
.or_else(|| Some("None".to_string())).unwrap());

let create = self.params[idx].is_none();

Expand Down

0 comments on commit 8f1d3c1

Please sign in to comment.