better logging

This commit is contained in:
mertalev 2023-09-16 00:52:01 -04:00
parent ca5f0c7bbd
commit e411eeaedb
No known key found for this signature in database
GPG key ID: 9181CD92C0A1C5E3
2 changed files with 6 additions and 6 deletions

View file

@ -2,12 +2,9 @@ import logging
import os
from pathlib import Path
import gunicorn
import starlette
from pydantic import BaseSettings
from rich.console import Console
from rich.logging import RichHandler
from .schemas import ModelType
@ -59,9 +56,12 @@ log_settings = LogSettings()
class CustomRichHandler(RichHandler):
def __init__(self) -> None:
console = Console(color_system="standard", no_color=log_settings.no_color)
console = Console(no_color=log_settings.no_color, force_interactive=True, stderr=True)
super().__init__(
show_path=False, omit_repeated_times=False, console=console, tracebacks_suppress=[gunicorn, starlette]
show_path=False,
omit_repeated_times=False,
console=console,
tracebacks_width=100,
)

View file

@ -1,6 +1,6 @@
{
"version": 1,
"disable_existing_loggers": true,
"disable_existing_loggers": false,
"formatters": { "rich": { "show_path": false, "omit_repeated_times": false } },
"handlers": {
"console": {