From a51ed9ebe4f43dae216bfef8d8ce5336af3f5771 Mon Sep 17 00:00:00 2001 From: Andray Date: Mon, 11 Mar 2024 19:28:12 +0400 Subject: [PATCH] fix logger level --- deoldify/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deoldify/__init__.py b/deoldify/__init__.py index 48563b0..d75ed46 100644 --- a/deoldify/__init__.py +++ b/deoldify/__init__.py @@ -1,7 +1,14 @@ import sys import logging -logging.getLogger().addHandler(logging.StreamHandler(sys.stdout)) -logging.getLogger().setLevel(logging.INFO) +try: + import modules.shared + IS_INSIDE_WEBUI = True +except ImportError: + IS_INSIDE_WEBUI = False + +if not IS_INSIDE_WEBUI: + logging.getLogger().addHandler(logging.StreamHandler(sys.stdout)) + logging.getLogger().setLevel(logging.INFO) from deoldify._device import _Device