Initial commit

This commit is contained in:
2026-01-26 12:40:24 +00:00
commit 5d94e292b8
9 changed files with 860 additions and 0 deletions

25
logging_config.py Normal file
View File

@@ -0,0 +1,25 @@
import sys
import logging
from rich.logging import RichHandler
from rich.console import Console
def setup_logging(level=logging.INFO, debug=False):
# silence noisy libraries
for lib_name in ("urllib3","requests","http.client","markdown","Markdown"):
logging.getLogger(lib_name).setLevel(logging.WARNING)
logging.basicConfig(
level=level,
format="%(message)s",
datefmt="[%X]",
handlers=[RichHandler(
rich_tracebacks=True,
show_path=False,
log_time_format="[%H:%M:%S]",
markup=True
)],
)
if debug:
logging.getLogger(__name__).debug("[dim]Debug mode active.[/dim]")