summaryrefslogtreecommitdiff
path: root/src/debug.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2024-10-31 18:09:35 +1300
committerBen Bridle <ben@derelict.engineering>2024-10-31 18:11:11 +1300
commitb9bc4d1ef710dcde625c7cf24293750168bbd225 (patch)
treeea6f97eb82b4edbcddc637772759bbf1942a110a /src/debug.rs
parentdafa39853a6fc43f6a803ff6436b0f6d25373368 (diff)
downloadbedrock-pc-b9bc4d1ef710dcde625c7cf24293750168bbd225.zip
Print debug messages as info-level log messages
Debug messages are now printed with a blue [INFO] prefix, to match the style of the information messages printed by the rest of the project.
Diffstat (limited to 'src/debug.rs')
-rw-r--r--src/debug.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/debug.rs b/src/debug.rs
index 8be5bb9..17ed604 100644
--- a/src/debug.rs
+++ b/src/debug.rs
@@ -5,6 +5,7 @@ use std::time::Instant;
const NORMAL: &str = "\x1b[0m";
+const BOLD: &str = "\x1b[1m";
const DIM: &str = "\x1b[2m";
const YELLOW: &str = "\x1b[33m";
const BLUE: &str = "\x1b[34m";
@@ -27,9 +28,9 @@ impl DebugState {
}
}
- pub fn print(&self, string: &str) {
+ pub fn info(&self, string: &str) {
if self.enabled {
- println!("{}", string);
+ eprintln!("{BOLD}{BLUE}[INFO]{NORMAL}: {string}{NORMAL}");
}
}