MCPcopy Index your code
hub / github.com/StackStorm/st2 / _detect_log_lines

Function _detect_log_lines

tools/log_watcher.py:109–124  ·  view source on GitHub ↗
(fil, matchers)

Source from the content-addressed store, hash-verified

107
108
109def _detect_log_lines(fil, matchers):
110 global FILE_LOG_COUNT
111 FILE_LOG_COUNT[fil] = dict(_get_log_count_dict())
112 # print('Working on file: %s' % fil)
113 with open(fil) as f:
114 lines = f.readlines()
115 FILE_LINE_COUNT[fil] = len(lines)
116
117 ln = 0
118 for line in lines:
119 line = line.strip()
120 ln += 1
121 matched, level, line = _match(line, matchers)
122 if matched:
123 # print('File: %s, Level: %s, Line: %d:%s' % (fil, level, ln, line.strip()))
124 FILE_LOG_COUNT[fil][level] += 1
125
126
127def _post_process(file_dir):

Callers 1

mainFunction · 0.85

Calls 2

_get_log_count_dictFunction · 0.85
_matchFunction · 0.85

Tested by

no test coverage detected