update logging

This commit is contained in:
Beverly Nguyen
2025-04-14 14:49:19 -07:00
parent da695557b0
commit 638a4f20da
2 changed files with 4 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ import usaButton %} {% block meta %}
{% block beforeContent %}{% endblock %}
<main id="main-content" role="main">
{% if counts.live_service_count == 'N/A' %}
{% if counts %}
<div class="usa-alert usa-alert--info usa-alert--slim" aria-label="Site alert,,,,">
<div class="grid-container padding-x-0">
<div class="usa-alert__body">

View File

@@ -15,6 +15,7 @@ class ColorFormatter(logging.Formatter):
'DEBUG': '\033[94m',
'WARNING': '\033[93m',
'ERROR': '\033[91m',
'CRITICAL': '\033[95m',
}
RESET = '\033[0m'
@@ -93,7 +94,6 @@ def init_app(app):
def get_handlers(app):
handlers = []
color_formatter = ColorFormatter(LOG_FORMAT, TIME_FORMAT)
json_formatter = JSONFormatter(LOG_FORMAT, TIME_FORMAT)
stream_handler = logging.StreamHandler(sys.stdout)
@@ -106,6 +106,8 @@ def get_handlers(app):
return not ("GET /static/" in msg and " 200 " in msg)
logging.getLogger("werkzeug").addFilter(is_200_static_log)
color_formatter = ColorFormatter(LOG_FORMAT, TIME_FORMAT)
handlers.append(configure_handler(stream_handler, app, color_formatter))
return handlers