Improve pretty printing (#171)

This commit is contained in:
gagb 2024-07-02 17:50:08 -07:00 committed by GitHub
parent bcec0502d7
commit e0065cab42
2 changed files with 9 additions and 7 deletions

View File

@ -89,7 +89,7 @@ class MyHandler(logging.Handler):
def emit(self, record: logging.LogRecord) -> None:
try:
if isinstance(record.msg, OrchestrationEvent):
print(f"[{record.msg.timestamp}]: {record.msg.message}", flush=True)
print(record.msg.message, flush=True)
except Exception:
self.handleError(record)

View File

@ -35,11 +35,10 @@ class RoundRobinOrchestrator(TypeRoutedAgent):
logger.info(
OrchestrationEvent(
current_timestamp,
f"""
-------------------------------------
{source}: {message.content.content}
-------------------------------------
""",
f"""{source}:
{message.content.content}
-------------------------------------""",
)
)
@ -54,7 +53,10 @@ class RoundRobinOrchestrator(TypeRoutedAgent):
logger.info(
OrchestrationEvent(
current_timestamp,
f"Orchestrator (thought): Next speaker {next_agent.metadata['name']}",
f"""Orchestrator (thought):
Next speaker {next_agent.metadata['name']}
-------------------------------------""",
)
)