From 2e0fa1d03bf9e07b1c8caf3da3bc2cb4bf203b8a Mon Sep 17 00:00:00 2001 From: Abhinav Tuli <42538472+AbhinavTuli@users.noreply.github.com> Date: Mon, 13 Sep 2021 21:07:17 +0530 Subject: [PATCH] [Small] Fixes logging (#1153) --- conftest.py | 2 +- hub/client/log.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index dbcf0c9278..41b77a3320 100644 --- a/conftest.py +++ b/conftest.py @@ -7,7 +7,7 @@ os.environ["BUGGER_OFF"] = "true" os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" -logging.basicConfig(level=logging.ERROR) +logging.disable(logging.INFO) from hub.constants import * from hub.tests.common import SESSION_ID diff --git a/hub/client/log.py b/hub/client/log.py index 1b5c007f99..ac5861bb05 100644 --- a/hub/client/log.py +++ b/hub/client/log.py @@ -8,3 +8,11 @@ import sys logger = logging.getLogger("hub") + + +def configure_logger(debug=0): + log_level = logging.DEBUG if debug == 1 else logging.INFO + logging.basicConfig(format="%(message)s", level=log_level, stream=sys.stdout) + + +configure_logger(0)