From 31f2999b4b971176b57c09ecef5d5edfe39dcb53 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 10 Sep 2020 10:10:55 +0530 Subject: [PATCH] fix: Use NullHandler for commands executed outside a bench dir --- bench/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/utils.py b/bench/utils.py index 7e2f6662..8e76903f 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -444,12 +444,12 @@ def setup_logging(bench_path='.'): if os.path.exists(os.path.join(bench_path, 'logs')): log_file = os.path.join(bench_path, 'logs', 'bench.log') + hdlr = logging.FileHandler(log_file) else: - log_file = os.path.join(os.path.expanduser("~"), 'bench.log') + hdlr = logging.NullHandler() logger = logging.getLogger(bench.PROJECT_NAME) formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') - hdlr = logging.FileHandler(log_file) hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.DEBUG)