Skip to content

Commit 303054b

Browse files
authored
chore: use rich to format logs (#177)
Summary: Test Plan: Before <img width="1189" alt="image" src="https://github.com/user-attachments/assets/b92b321e-3b89-4b17-8459-1b449dc8c087" /> After <img width="1279" alt="image" src="https://github.com/user-attachments/assets/eaa0b09a-bf29-43e7-a8c0-abcd7f87e8df" /> --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/meta-llama/llama-stack-client-python/pull/177). * #178 * __->__ #177
1 parent 8e4fd56 commit 303054b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/llama_stack_client/_utils/_logs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import logging
3+
from rich.logging import RichHandler
34

45
logger: logging.Logger = logging.getLogger("llama_stack_client")
56
httpx_logger: logging.Logger = logging.getLogger("httpx")
@@ -10,6 +11,7 @@ def _basic_config() -> None:
1011
logging.basicConfig(
1112
format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s",
1213
datefmt="%Y-%m-%d %H:%M:%S",
14+
handlers=[RichHandler(rich_tracebacks=True)],
1315
)
1416

1517

0 commit comments

Comments
 (0)