Files
bmspy/bmspy/utilities.py
T

21 lines
468 B
Python
Executable File

#!/usr/bin/env python3
#
# Daemon: listens on a Unix socket and serves JBD BMS data to clients
#
import datetime
import pprint
from typing import Any
def debugger(data: Any, pretty: bool = False) -> None:
if pretty:
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(
{
"time": datetime.datetime.now(),
"data": data,
}
)
msg = f"{str(datetime.datetime.now())} {data}"
print(msg)