MCPcopy Create free account
hub / github.com/WorldModelBench-Team/WorldModelBench / RichLogHandler

Class RichLogHandler

evaluation.py:195–207  ·  view source on GitHub ↗

Custom logging handler that uses Rich for formatting.

Source from the content-addressed store, hash-verified

193 Console().print(f"[green]Results saved to: {save_path}[/green]")
194
195class RichLogHandler(logging.Handler):
196 """Custom logging handler that uses Rich for formatting."""
197 def __init__(self):
198 super().__init__()
199 self.console = Console()
200
201 def emit(self, record):
202 try:
203 msg = self.format(record)
204 style = "bold red" if record.levelno >= logging.WARNING else "blue"
205 self.console.print(f"[{style}]{msg}[/{style}]")
206 except Exception:
207 self.handleError(record)
208
209def main():
210 import argparse

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected