From a2408cd14317e1c0969953f8745034d78b2b9bcf Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 3 Feb 2025 09:51:32 +1300 Subject: Use log crate for printing info and error messages --- src/debug.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/debug.rs') diff --git a/src/debug.rs b/src/debug.rs index 6270948..7fd4ea5 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -5,7 +5,6 @@ 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"; @@ -13,29 +12,21 @@ const BLUE: &str = "\x1b[34m"; pub struct DebugState { pub enabled: bool, - pub verbose: bool, last_cycle: usize, last_mark: Instant, symbols: DebugSymbols, } impl DebugState { - pub fn new>(enabled: bool, verbose: bool, symbols_path: Option

) -> Self { + pub fn new>(enabled: bool, symbols_path: Option

) -> Self { Self { enabled, - verbose, last_cycle: 0, last_mark: Instant::now(), symbols: DebugSymbols::from_path_opt(symbols_path), } } - pub fn info(&self, string: &str) { - if self.verbose { - eprintln!("{BOLD}{BLUE}[INFO]{NORMAL}: {string}{NORMAL}"); - } - } - pub fn debug_summary(&mut self, core: &BedrockCore) { if self.enabled { let prev_pc = core.mem.pc.wrapping_sub(1); -- cgit v1.2.3-70-g09d2