From 4683b87a3288924d33c32cd0991ea2a27c743b56 Mon Sep 17 00:00:00 2001 From: Arcmyx Official Date: Fri, 10 Apr 2026 17:25:22 +0000 Subject: [PATCH] Update tests/pynamics-logger.py --- tests/pynamics-logger.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/pynamics-logger.py b/tests/pynamics-logger.py index 375ad2c..aa90f5f 100644 --- a/tests/pynamics-logger.py +++ b/tests/pynamics-logger.py @@ -8,6 +8,7 @@ #6: perf_smpl #7: get_time #8: breakpoint +verboseness = 7 lvldict = { 0: "FATAL", 1: "ALERT", @@ -22,18 +23,18 @@ stpwtchtime = StopWatch() stpwtchtime.pause() def start(): - self.time.reset() - self.time.resume() + stpwtchtime.reset() + stpwtchtime.resume() def log(self, message, level, origin): - if level <= self.verboseness: - ms = self.time.time() + if level <= verboseness: + ms = stpwtchtime.time() timestamp = "{:02d}:{:02d}.{:03d}".format( (ms // 60000) % 60, (ms // 1000) % 60, ms % 1000 ) - label = self.lvldict.get(level, "UNKNOWN") + label = lvldict.get(level, "UNKNOWN") padding = " " * (7 - len(label)) print("[{}] {}{} [{}] {}".format(timestamp, label, padding, origin, message)) @@ -50,9 +51,9 @@ def notice(self, message, origin): notify(message, 5, origin) def info(self, message, origin): notify(message, 6, origin) def debug(self, message, origin): notify(message, 7, origin) def crash(self, message, origin): - sendCommand(3, 0, "program kinda crashed bc you suck at coding", origin) + sendCommand(3, 0, "uhhhh so the program kinda crashed sorry", origin) raise FatalLoggerError("[FATAL] [{}] {}".format(origin, message)) -sendCommand(0, 0, "hey you should probably know that your RAM is corrupted and you cant buy more because of the shortage. byeeeee", "test prgm") +sendCommand(0, 0, "hey you should probably know that your RAM is corrupted and you cant replace it because of the shortage. byeeeee", "test prgm") sendCommand(0, 1, "UNRECOVERABLE PYTHON ERROR!!!!! Exiting gracefully... JUST KIDDING WHAT DID YOU THINK IT WAS GONNA DO", "test prgm") sendCommand(0, 2, "so the program is running but it just started looping on the motor frying bit of your program.", "test prgm") sendCommand(0, 3, "syntax error, you failure!!!! use an error checker", "test prgm")