From 9d9ab7e7dd26dc90f7ea5f944dfd24ed95562c4f Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Thu, 27 Mar 2025 15:18:21 +0100 Subject: [PATCH] chore: Remove style tags from log formatter (#1808) # What does this PR do? Set a formatter for log file handler that does not pollute log messages with color tags. ## Test Plan Successfully tested with `LLAMA_STACK_LOG_FILE=server.log llama stack run ...` --- llama_stack/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_stack/log.py b/llama_stack/log.py index 0ba95d547..3835b74a1 100644 --- a/llama_stack/log.py +++ b/llama_stack/log.py @@ -139,7 +139,7 @@ def setup_logging(category_levels: Dict[str, int], log_file: str | None) -> None category_levels (Dict[str, int]): A dictionary mapping categories to their log levels. log_file (str): Path to a log file to additionally pipe the logs into """ - log_format = "[dim]%(asctime)s %(name)s:%(lineno)d[/] [yellow dim]%(category)s[/]: %(message)s" + log_format = "%(asctime)s %(name)s:%(lineno)d %(category)s: %(message)s" class CategoryFilter(logging.Filter): """Ensure category is always present in log records."""