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

Function log_message

internagent/experiments_utils_iflow.py:159–168  ·  view source on GitHub ↗

Write message to both stdout and log file

(msg)

Source from the content-addressed store, hash-verified

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

Callers 2

run_experimentFunction · 0.70
perform_experimentsFunction · 0.70

Calls 2

writeMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected