mirror of
https://github.com/morgan9e/bitwarden-desktop-agent
synced 2026-04-14 00:04:06 +09:00
Improvements and fixes
This commit is contained in:
8
log.py
8
log.py
@@ -3,19 +3,23 @@ import time
|
||||
|
||||
_start = time.monotonic()
|
||||
|
||||
|
||||
def _ts() -> str:
|
||||
elapsed = time.monotonic() - _start
|
||||
return f"{elapsed:8.3f}"
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user