MCPcopy Create free account
hub / github.com/ddnet/ddnet / Log

Class Log

scripts/integration_test.py:26–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26class Log(namedtuple("Log", "timestamp level line")):
27 @classmethod
28 def parse(cls, line):
29 if line.startswith("=="):
30 pid, line = line[2:].split("== ", 1)
31 return cls(None, "valgrind", f"{pid}: {line}")
32 elif not line.startswith("["):
33 # DDNet log
34 date, time, level, line = line.split(" ", 3)
35 return cls(f"{date} {time}", level, line)
36 else:
37 # Rust log
38 datetime, level, line = line.split(" ", 2)
39 return cls(datetime.removeprefix("["), level, line.removeprefix(" ").replace("]", ":", 1))
40
41 def raise_on_error(self, timeout_id):
42 pass
43
44
45class Exit(namedtuple("Exit", "")):

Callers 2

ReportMethod · 0.85
threadFunction · 0.85

Calls

no outgoing calls

Tested by 1

threadFunction · 0.68