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

Method dump_to_file

plain2code_logger.py:97–111  ·  view source on GitHub ↗
(self, filepath, formatter=None)

Source from the content-addressed store, hash-verified

95 self.records.append(record)
96
97 def dump_to_file(self, filepath, formatter=None):
98 if not self.records:
99 return False
100
101 try:
102 with open(filepath, "w", encoding="utf-8") as f:
103 for record in self.records:
104 if formatter:
105 msg = formatter.format(record)
106 else:
107 msg = self.format(record)
108 f.write(msg + "\n")
109 return True
110 except Exception:
111 return False
112
113
114def get_log_file_path(plain_file_path: Optional[str], log_file_name: str) -> Optional[str]:

Callers 1

dump_crash_logsFunction · 0.80

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected