Pattern matching works now

This commit is contained in:
2025-11-27 22:47:02 +01:00
parent 4f989271c5
commit ecf151158d
22 changed files with 146 additions and 150 deletions

View File

@@ -13,6 +13,7 @@ impl Logger {
pub fn new(strat: api::LogStrategy) -> Self { Self(strat) }
pub fn log(&self, msg: impl AsRef<str>) { writeln!(self, "{}", msg.as_ref()) }
pub fn strat(&self) -> api::LogStrategy { self.0.clone() }
pub fn is_active(&self) -> bool { !matches!(self.0, api::LogStrategy::Discard) }
pub fn log_buf(&self, event: impl AsRef<str>, buf: &[u8]) {
if std::env::var("ORCHID_LOG_BUFFERS").is_ok_and(|v| !v.is_empty()) {
writeln!(self, "{}: [{}]", event.as_ref(), buf.iter().map(|b| format!("{b:02x}")).join(" "))