From e411eeaedbd8eb53d7c5a6fdc440e50381bd6c63 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Sat, 16 Sep 2023 00:52:01 -0400 Subject: [PATCH] better logging --- machine-learning/app/config.py | 10 +++++----- machine-learning/log_conf.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/machine-learning/app/config.py b/machine-learning/app/config.py index f3b41d22d..857acdb5c 100644 --- a/machine-learning/app/config.py +++ b/machine-learning/app/config.py @@ -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, ) diff --git a/machine-learning/log_conf.json b/machine-learning/log_conf.json index f94fe4309..4ffcc5bcf 100644 --- a/machine-learning/log_conf.json +++ b/machine-learning/log_conf.json @@ -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": {