| 123456789101112131415 |
- from __future__ import annotations
- from datetime import datetime
- import builtins
- from typing import Any
- def log_print(*args: Any, **kwargs: Any) -> None:
- sep = kwargs.get("sep", " ")
- end = kwargs.get("end", "\n")
- file = kwargs.get("file", None)
- flush = kwargs.get("flush", False)
- message = sep.join(str(arg) for arg in args)
- timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
- builtins.print(f"{timestamp} {message}", end=end, file=file, flush=flush)
|