MCPcopy Create free account
hub / github.com/catboost/catboost / setup_logging

Function setup_logging

library/python/pytest/plugins/ya.py:130–142  ·  view source on GitHub ↗
(log_path, level=logging.DEBUG, *other_logs)

Source from the content-addressed store, hash-verified

128
129
130def setup_logging(log_path, level=logging.DEBUG, *other_logs):
131 logs = [log_path] + list(other_logs)
132 root_logger = logging.getLogger()
133 for i in range(len(root_logger.handlers) - 1, -1, -1):
134 if isinstance(root_logger.handlers[i], YaTestLoggingFileHandler):
135 root_logger.handlers.pop(i).close()
136 root_logger.setLevel(level)
137 for log_file in logs:
138 file_handler = YaTestLoggingFileHandler(log_file)
139 log_format = '%(asctime)s - %(levelname)s - %(name)s.%(process)d - %(funcName)s: %(message)s'
140 file_handler.setFormatter(_TokenFilterFormatter(log_format))
141 file_handler.setLevel(level)
142 root_logger.addHandler(file_handler)
143
144
145class YaHookspec:

Callers 2

pytest_configureFunction · 0.85
pytest_runtest_setupFunction · 0.85

Calls 8

lenFunction · 0.85
isinstanceFunction · 0.85
listClass · 0.50
rangeFunction · 0.50
closeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected