MCPcopy
hub / github.com/ActivityWatch/activitywatch / collect

Function collect

scripts/logcrawler.py:22–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21
22def collect():
23 matched_lines = defaultdict(lambda: [])
24 for filepath in sorted(get_filepaths()):
25 with open(filepath, "r") as f:
26 log = f.read()
27 for line in log.split("\n"):
28 s = re.search("(ERR|WARN)", line)
29 ignored = re.search("(CORS|Deleted bucket)", line)
30 if s and not ignored:
31 matched_lines[filepath].append(line)
32 return matched_lines
33
34
35_date_reg_exp = re.compile('\d{4}-\d{2}-\d{2}')

Callers 1

mainFunction · 0.85

Calls 1

get_filepathsFunction · 0.85

Tested by

no test coverage detected