From adee5a53b8f9344a2a16864ab0d020eb6c3ff27e Mon Sep 17 00:00:00 2001 From: ThreadDao Date: Thu, 11 Nov 2021 22:10:56 +0800 Subject: [PATCH] Fix test log error Is a directory (#11690) Signed-off-by: ThreadDao --- tests/python_client/utils/util_log.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/python_client/utils/util_log.py b/tests/python_client/utils/util_log.py index b2ff36f0d..3a865b84d 100644 --- a/tests/python_client/utils/util_log.py +++ b/tests/python_client/utils/util_log.py @@ -34,10 +34,11 @@ class TestLog: eh.setFormatter(formatter) self.log.addHandler(eh) - wh = logging.FileHandler(self.log_worker) - wh.setLevel(logging.DEBUG) - wh.setFormatter(formatter) - self.log.addHandler(wh) + if self.log_worker != "": + wh = logging.FileHandler(self.log_worker) + wh.setLevel(logging.DEBUG) + wh.setFormatter(formatter) + self.log.addHandler(wh) ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) -- GitLab