better logging
This commit is contained in:
parent
ca5f0c7bbd
commit
e411eeaedb
2 changed files with 6 additions and 6 deletions
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in a new issue