Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs_tofupilot/logger/client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ def __init__(self):
self.logs = []

def emit(self, record):
# Format log with ISO-8601 timestamp (millisecond precision) for
# TofuPilot API
# Format log with ISO-8601 timestamp (UTC, ms) for TofuPilot API
log_entry = {
"level": record.levelname,
"timestamp": f"{datetime.fromtimestamp(record.created).isoformat(timespec='milliseconds')}Z",
"timestamp": datetime.utcfromtimestamp(record.created).isoformat(
timespec="milliseconds"
)
+ "Z",
"message": record.getMessage(),
"source_file": record.filename,
"line_number": record.lineno,
Expand Down
Loading