MCPcopy Create free account
hub / github.com/hunvreus/devpush / parse_log

Function parse_log

app/utils/log.py:78–88  ·  view source on GitHub ↗

Parse log line into timestamp, timestamp_iso, message, and level.

(log: str)

Source from the content-addressed store, hash-verified

76
77
78def parse_log(log: str):
79 """Parse log line into timestamp, timestamp_iso, message, and level."""
80 timestamp, separator, message = log.partition(" ")
81 level = _get_level(message)
82
83 return {
84 "timestamp": timestamp if separator else None,
85 "timestamp_iso": iso_nano_to_iso(timestamp) if separator else None,
86 "message": message if separator else timestamp,
87 "level": level,
88 }
89
90
91def iso_nano_to_iso(ts: str) -> str:

Callers 1

parse_logsMethod · 0.90

Calls 2

_get_levelFunction · 0.85
iso_nano_to_isoFunction · 0.85

Tested by

no test coverage detected