From 5c11477c9d683f436d7ac28f2f1a1ab4a48a1b80 Mon Sep 17 00:00:00 2001 From: Ric Evans <19216225+ric-evans@users.noreply.github.com> Date: Thu, 4 Feb 2021 12:24:53 -0600 Subject: [PATCH] Logging Format Updates (#67) * add coloredlogs to requirements.txt * add coloredlogs.install() --- file_catalog/__main__.py | 6 ++++-- requirements.txt | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/file_catalog/__main__.py b/file_catalog/__main__.py index b6da00f..36158a2 100644 --- a/file_catalog/__main__.py +++ b/file_catalog/__main__.py @@ -4,6 +4,7 @@ import logging import os +import coloredlogs # type: ignore[import] from file_catalog.server import Server from file_catalog.config import Config from pprint import pprint @@ -20,8 +21,9 @@ def main(): config = Config() config.update_from_env() - - logging.basicConfig(level=('DEBUG' if config['DEBUG'] else 'INFO')) + + coloredlogs.install(level=('DEBUG' if config['DEBUG'] else 'INFO')) + try: Server(config, port=config['FC_PORT'], diff --git a/requirements.txt b/requirements.txt index cfa7b63..15355ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ Babel==2.7.0 certifi==2019.9.11 cffi==1.13.0 chardet==3.0.4 +coloredlogs==14.0 coverage==4.5.4 cryptography==3.2 docutils==0.15.2