Make the debug logging functions consistent

They now all output the same format of:
[time since program start] msg
This commit is contained in:
Kovid Goyal
2024-04-08 12:53:55 +05:30
parent 208490f4e1
commit 8fc96c5bd7
23 changed files with 73 additions and 58 deletions

View File

@@ -43,6 +43,7 @@ from .constants import (
ssh_control_master_template,
)
from .fast_data_types import WINDOW_FULLSCREEN, WINDOW_MAXIMIZED, WINDOW_MINIMIZED, WINDOW_NORMAL, Color, Shlex, get_options, monotonic, open_tty
from .fast_data_types import timed_debug_print as _timed_debug_print
from .rgb import to_color
from .types import run_once
from .typing import AddressFamily, PopenType, Socket, StartupCtx
@@ -1236,3 +1237,7 @@ def shlex_split_with_positions(text: str) -> Iterator[Tuple[int, str]]:
s = Shlex(text)
while (q := s.next_word())[0] > -1:
yield q
def timed_debug_print(*a: Any, sep: str = ' ', end: str = '\n') -> None:
_timed_debug_print(sep.join(map(str, a)) + end)