MCPcopy Create free account
hub / github.com/InternScience/InternAgent / log_message

Function log_message

internagent/experiments_utils_claude.py:161–170  ·  view source on GitHub ↗

Write message to both stdout and log file

(msg)

Source from the content-addressed store, hash-verified

159 Tuple of (return_code, next_prompt, traceback, message)
160 """
161 def log_message(msg):
162 """Write message to both stdout and log file"""
163 print(msg)
164 sys.stdout.flush()
165 if log_file:
166 try:
167 log_file.write(msg + "\n")
168 log_file.flush()
169 except (ValueError, OSError):
170 pass
171
172 timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
173 logger.info(f"[{timestamp}] Starting experiment run {run_num} in {folder_name}")

Callers 4

run_experimentFunction · 0.70
_drain_stdoutFunction · 0.70
perform_experimentsFunction · 0.70
_handle_sci_run_scoringFunction · 0.70

Calls 2

writeMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected