MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / _write_log

Method _write_log

mini_agent/logger.py:159–174  ·  view source on GitHub ↗

Write log entry Args: log_type: Log type (REQUEST, RESPONSE, TOOL_RESULT) content: Log content

(self, log_type: str, content: str)

Source from the content-addressed store, hash-verified

157 self._write_log("TOOL_RESULT", content)
158
159 def _write_log(self, log_type: str, content: str):
160 """Write log entry
161
162 Args:
163 log_type: Log type (REQUEST, RESPONSE, TOOL_RESULT)
164 content: Log content
165 """
166 if self.log_file is None:
167 return
168
169 with open(self.log_file, "a", encoding="utf-8") as f:
170 f.write("\n" + "-" * 80 + "\n")
171 f.write(f"[{self.log_index}] {log_type}\n")
172 f.write(f"Timestamp: {datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]}\n")
173 f.write("-" * 80 + "\n")
174 f.write(content + "\n")
175
176 def get_log_file_path(self) -> Path:
177 """Get current log file path"""

Callers 3

log_requestMethod · 0.95
log_responseMethod · 0.95
log_tool_resultMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected