MCPcopy Index your code
hub / github.com/Codeplain-ai/codeplain / dump_crash_logs

Function dump_crash_logs

plain2code_logger.py:122–136  ·  view source on GitHub ↗

Dump buffered logs to file if CrashLogHandler is present.

(args, run_state: RunState, formatter=None)

Source from the content-addressed store, hash-verified

120
121
122def dump_crash_logs(args, run_state: RunState, formatter=None):
123 """Dump buffered logs to file if CrashLogHandler is present."""
124 if args.log_to_file:
125 return
126
127 if formatter is None:
128 formatter = ElapsedTimeFormatter(run_state)
129
130 root_logger = logging.getLogger(LOGGER_NAME)
131 crash_handler = next((h for h in root_logger.handlers if isinstance(h, CrashLogHandler)), None)
132
133 if crash_handler and args.filename:
134 log_file_path = get_log_file_path(args.filename, args.log_file_name)
135
136 crash_handler.dump_to_file(log_file_path, formatter)

Callers 1

mainFunction · 0.90

Calls 3

get_log_file_pathFunction · 0.85
dump_to_fileMethod · 0.80

Tested by

no test coverage detected