mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-05 14:55:18 +02:00
modify log interface
This commit is contained in:
parent
53240b91f2
commit
c6a791cd32
2 changed files with 3 additions and 3 deletions
|
|
@ -43,14 +43,14 @@ class Terminal:
|
|||
f'echo "{self.end_marker}"' + self.command_terminator
|
||||
) # Unique marker to signal command end
|
||||
self.process.stdin.flush()
|
||||
log_tool_output(output=cmd + self.command_terminator, tool_name="Terminal") # log the command
|
||||
log_tool_output(output={"cmd": cmd + self.command_terminator}, tool_name="Terminal") # log the command
|
||||
|
||||
# Read the output until the unique marker is found
|
||||
while True:
|
||||
line = self.process.stdout.readline()
|
||||
if line.strip() == self.end_marker:
|
||||
break
|
||||
log_tool_output(output=line, tool_name="Terminal") # log stdout in real-time
|
||||
log_tool_output(output={"output": line}, tool_name="Terminal") # log stdout in real-time
|
||||
cmd_output.append(line)
|
||||
|
||||
return "".join(cmd_output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue