From 72711e257812c01183a948de4d724cab071e8646 Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Tue, 26 Aug 2025 05:46:53 -0500 Subject: [PATCH] try out? --- codeflash/cli_cmds/logging_config.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/codeflash/cli_cmds/logging_config.py b/codeflash/cli_cmds/logging_config.py index e546836fc..e2c3f7c6a 100644 --- a/codeflash/cli_cmds/logging_config.py +++ b/codeflash/cli_cmds/logging_config.py @@ -1,4 +1,4 @@ -VERBOSE_LOGGING_FORMAT = "%(asctime)s [%(pathname)s:%(lineno)s in function %(funcName)s] %(message)s" +VERBOSE_LOGGING_FORMAT = "%(asctime)s [%(pathname)s:%(lineno)s in fn %(funcName)s] %(message)s" LOGGING_FORMAT = "[%(levelname)s] %(message)s" BARE_LOGGING_FORMAT = "%(message)s" @@ -11,9 +11,16 @@ def set_level(level: int, *, echo_setting: bool = True) -> None: from codeflash.cli_cmds.console import console + class RuleAfterLogHandler(RichHandler): + def emit(self, record: logging.LogRecord) -> None: + super().emit(record) + console.rule() + logging.basicConfig( level=level, - handlers=[RichHandler(rich_tracebacks=True, markup=False, console=console, show_path=False, show_time=False)], + handlers=[ + RuleAfterLogHandler(rich_tracebacks=True, markup=False, console=console, show_path=False, show_time=False) + ], format=BARE_LOGGING_FORMAT, ) logging.getLogger().setLevel(level) @@ -23,11 +30,12 @@ def set_level(level: int, *, echo_setting: bool = True) -> None: logging.basicConfig( format=VERBOSE_LOGGING_FORMAT, handlers=[ - RichHandler(rich_tracebacks=True, markup=False, console=console, show_path=False, show_time=False) + RuleAfterLogHandler( + rich_tracebacks=True, markup=False, console=console, show_path=False, show_time=False + ) ], force=True, ) logging.info("Verbose DEBUG logging enabled") else: logging.info("Logging level set to INFO") - console.rule()