diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-02-03 09:51:32 +1300 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-02-03 09:51:32 +1300 |
commit | a2408cd14317e1c0969953f8745034d78b2b9bcf (patch) | |
tree | af1224a20b8d4d62790c9a6935986b84f1bb87d7 /src/debug.rs | |
parent | 0070a300bc281d15a695709b7dd2e1cb9017913a (diff) | |
download | bedrock-pc-a2408cd14317e1c0969953f8745034d78b2b9bcf.zip |
Use log crate for printing info and error messages
Diffstat (limited to 'src/debug.rs')
-rw-r--r-- | src/debug.rs | 11 |
1 files changed, 1 insertions, 10 deletions
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<P: AsRef<Path>>(enabled: bool, verbose: bool, symbols_path: Option<P>) -> Self { + pub fn new<P: AsRef<Path>>(enabled: bool, symbols_path: Option<P>) -> 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); |