1
0

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 {
Err(VmError::StackOverflow(position))
} else {
let value = if value.is_raw() {
value.into_reference()
} else {
value
};
self.stack.push(value);
Ok(())

View File

@ -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();