Preffify logs

This commit is contained in:
Jeff 2024-09-11 04:33:53 -04:00
parent 86f8e47b0c
commit 974310ffab
2 changed files with 7 additions and 10 deletions

View File

@ -247,12 +247,6 @@ impl Vm {
if self.stack.len() == Self::STACK_SIZE { if self.stack.len() == Self::STACK_SIZE {
Err(VmError::StackOverflow(position)) Err(VmError::StackOverflow(position))
} else { } else {
let value = if value.is_raw() {
value.into_reference()
} else {
value
};
self.stack.push(value); self.stack.push(value);
Ok(()) Ok(())

View File

@ -26,13 +26,16 @@ fn main() {
Level::Info => "INFO".white(), Level::Info => "INFO".white(),
Level::Debug => "DEBUG".blue(), Level::Debug => "DEBUG".blue(),
Level::Trace => "TRACE".purple(), Level::Trace => "TRACE".purple(),
}; }
.bold();
let level_display = format!("[{level:^5}]").white().on_black();
let module = record let module = record
.module_path() .module_path()
.map(|path| path.split("::").last().unwrap_or("UNKNOWN").to_uppercase()) .map(|path| path.split("::").last().unwrap_or("unknown"))
.unwrap_or("UNKNOWN".to_string()); .unwrap_or("unknown")
.dimmed();
writeln!(buf, "[{level:^5}] {module:^6} {}", record.args()) writeln!(buf, "{level_display} {module:^6} {}", record.args())
}) })
.init(); .init();