# HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1599817847 -7200 # Fri Sep 11 11:50:47 2020 +0200 # Node ID cbb341206b06e732a1c4252ecaf4326fc8e1f65c # Parent 80c8f8a25f42469332f01ed5794c7219188c0830 ✨ add library to have colored logs diff --git a/NEWS.rst b/NEWS.rst --- a/NEWS.rst +++ b/NEWS.rst @@ -9,6 +9,8 @@ Fix missing PyYAML dependency. + +Colored logs. 4.1 --- diff --git a/odoo_scripts/parsing.py b/odoo_scripts/parsing.py --- a/odoo_scripts/parsing.py +++ b/odoo_scripts/parsing.py @@ -4,6 +4,8 @@ import logging from typing import Optional +import coloredlogs + def add_verbosity_to_parser(parser: argparse.ArgumentParser): parser.add_argument( @@ -23,9 +25,8 @@ level = logging.INFO else: level = logging.DEBUG - logging.basicConfig( - level=level, - format="%(asctime)s %(levelname)8s [%(lineno)3d]: %(message)s", + coloredlogs.install( + level, fmt="%(asctime)s %(levelname)8s %(name)s %(message)s" ) diff --git a/requirements b/requirements --- a/requirements +++ b/requirements @@ -3,6 +3,7 @@ requests_toolbelt==0.8.0 python-dateutil>=2.7.0 PyYAML +coloredlogs docker psycopg2 mercurial >=5.2 diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ "odoorpc==0.7.0", "requests_toolbelt==0.8.0", "python-dateutil>=2.7.0", + "coloredlogs", "PyYAML", ], extras_require={