Files
bitwarden-desktop-agent/log.py
2026-03-20 02:50:59 +09:00

26 lines
426 B
Python

import sys
import time
_start = time.monotonic()
def _ts() -> str:
return f"{time.monotonic() - _start:8.3f}"
def info(msg: str):
print(f"[{_ts()}] {msg}", file=sys.stderr, flush=True)
def warn(msg: str):
print(f"[{_ts()}] WARN {msg}", file=sys.stderr, flush=True)
def error(msg: str):
print(f"[{_ts()}] ERROR {msg}", file=sys.stderr, flush=True)
def fatal(msg: str):
error(msg)
sys.exit(1)