Coverage for bookbuilderpy/logger.py: 100%
5 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-07-17 23:15 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-07-17 23:15 +0000
1"""The `logger` routine for writing a log string to stdout."""
2import datetime
3from typing import Callable, Final
5#: the "now" function
6__DTN: Final[Callable[[], datetime.datetime]] = datetime.datetime.now
9def logger(message: str) -> None:
10 """
11 Write a message to the log.
13 :param message: the message
14 """
15 print(f"{__DTN()}: {message}", flush=True) # noqa