From 93d4dce5d51bdf50bb8278fc2ea8abf7acef0508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ru=C5=BEi=C4=8Dka?= Date: Thu, 7 Feb 2019 15:06:16 +0100 Subject: [PATCH] log: set default log level to WARNING Verbose operation can be enabled by setting proper log level on 'distroinfo' logger, but don't spam by default. Change-Id: I61ea3a61b39199e661f5f668a357bb05b6d56832 --- distroinfo/__init__.py | 5 +++++ distroinfo/fetch.py | 1 - distroinfo/repoman.py | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/distroinfo/__init__.py b/distroinfo/__init__.py index c6583d4..d126880 100644 --- a/distroinfo/__init__.py +++ b/distroinfo/__init__.py @@ -1,4 +1,9 @@ import pbr.version +import logging + + +logging.basicConfig(level=logging.WARNING) +logging.getLogger("distroinfo").setLevel(logging.WARNING) version_info = pbr.version.VersionInfo('distroinfo') try: diff --git a/distroinfo/fetch.py b/distroinfo/fetch.py index 436de14..a52d107 100644 --- a/distroinfo/fetch.py +++ b/distroinfo/fetch.py @@ -9,7 +9,6 @@ from distroinfo import repoman -logging.basicConfig(level=logging.ERROR) log = logging.getLogger("distroinfo") diff --git a/distroinfo/repoman.py b/distroinfo/repoman.py index cf81caa..7a7ae88 100644 --- a/distroinfo/repoman.py +++ b/distroinfo/repoman.py @@ -9,7 +9,6 @@ from distroinfo.helpers import git -logging.basicConfig(level=logging.ERROR) log = logging.getLogger("distroinfo")