From 974310ffab324c79bee235f3f22629805724e9e9 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 11 Sep 2024 04:33:53 -0400 Subject: [PATCH] Preffify logs --- dust-lang/src/vm.rs | 6 ------ dust-shell/src/main.rs | 11 +++++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dust-lang/src/vm.rs b/dust-lang/src/vm.rs index e7cd931..ca50aea 100644 --- a/dust-lang/src/vm.rs +++ b/dust-lang/src/vm.rs @@ -247,12 +247,6 @@ impl Vm { if self.stack.len() == Self::STACK_SIZE { Err(VmError::StackOverflow(position)) } else { - let value = if value.is_raw() { - value.into_reference() - } else { - value - }; - self.stack.push(value); Ok(()) diff --git a/dust-shell/src/main.rs b/dust-shell/src/main.rs index 3cbf3cd..66bdaf3 100644 --- a/dust-shell/src/main.rs +++ b/dust-shell/src/main.rs @@ -26,13 +26,16 @@ fn main() { Level::Info => "INFO".white(), Level::Debug => "DEBUG".blue(), Level::Trace => "TRACE".purple(), - }; + } + .bold(); + let level_display = format!("[{level:^5}]").white().on_black(); let module = record .module_path() - .map(|path| path.split("::").last().unwrap_or("UNKNOWN").to_uppercase()) - .unwrap_or("UNKNOWN".to_string()); + .map(|path| path.split("::").last().unwrap_or("unknown")) + .unwrap_or("unknown") + .dimmed(); - writeln!(buf, "[{level:^5}] {module:^6} {}", record.args()) + writeln!(buf, "{level_display} {module:^6} {}", record.args()) }) .init();