From 8bfc20d44d3a0d040c6f7031f4975afd515e7424 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sun, 12 Jan 2025 10:52:59 +1300 Subject: Only print halt messages if the verbose flag is set This required passing the verbose flag state down into the DebugState structure. --- src/debug.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/debug.rs') diff --git a/src/debug.rs b/src/debug.rs index c01ee15..6270948 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -13,15 +13,17 @@ 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, symbols_path: Option

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

) -> Self { Self { enabled, + verbose, last_cycle: 0, last_mark: Instant::now(), symbols: DebugSymbols::from_path_opt(symbols_path), @@ -29,7 +31,7 @@ impl DebugState { } pub fn info(&self, string: &str) { - if self.enabled { + if self.verbose { eprintln!("{BOLD}{BLUE}[INFO]{NORMAL}: {string}{NORMAL}"); } } -- cgit v1.2.3-70-g09d2