From 76e6feda6fe7641fcb05f83d534dbde96ec432a5 Mon Sep 17 00:00:00 2001 From: xs5871 Date: Wed, 15 Mar 2023 22:28:36 +0000 Subject: [PATCH] Speed up and reduce memory footprint of debug template --- kmk/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kmk/utils.py b/kmk/utils.py index d8564d4..4cfa137 100644 --- a/kmk/utils.py +++ b/kmk/utils.py @@ -16,8 +16,10 @@ class Debug: def __init__(self, name: str = __name__): self.name = name - def __call__(self, message: str) -> None: - print(f'{ticks_ms()} {self.name}: {message}') + def __call__(self, *message: str) -> None: + print(ticks_ms(), end=' ') + print(self.name, end=': ') + print(*message) @property def enabled(self) -> bool: