MCPcopy Index your code
hub / github.com/dobin/SuperMega / write_logs

Method write_logs

observer.py:59–78  ·  view source on GitHub ↗
(self, working_dir: str)

Source from the content-addressed store, hash-verified

57
58
59 def write_logs(self, working_dir: str):
60 # Our log output
61 with open(f"{working_dir}log-supermega.log", "w") as f:
62 for line in observer.get_logs():
63 try:
64 f.write(line + "\n")
65 except Exception as e:
66 logger.warning("Error: {}".format(e))
67
68 # Stdout of executed commands
69 with open(f"{working_dir}log-cmdoutput.log", "w") as f:
70 for line in observer.get_cmd_output():
71 f.write(line)
72
73 # Write all files
74 idx = 0
75 for name, data in observer.files:
76 with open(f"{working_dir}log-{idx}-{name}", "w") as f:
77 f.write(data)
78 idx += 1
79
80
81observer = Observer()

Callers 1

startFunction · 0.80

Calls 3

get_logsMethod · 0.80
formatMethod · 0.80
get_cmd_outputMethod · 0.80

Tested by

no test coverage detected