From 72092bccfffa2bfb308951490a3fe18c0b4d10c7 Mon Sep 17 00:00:00 2001 From: smicallef Date: Sun, 15 Aug 2021 19:09:59 +0200 Subject: [PATCH] sf.py: Respect -q option to hide logging from stderr. --- sf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sf.py b/sf.py index 64090b7997..03e5cda976 100755 --- a/sf.py +++ b/sf.py @@ -38,10 +38,6 @@ log.setLevel(logging.DEBUG) log_format = logging.Formatter("%(asctime)s [%(levelname)s] %(message)s") -console_handler = logging.StreamHandler(sys.stderr) -console_handler.setFormatter(log_format) -log.addHandler(console_handler) - debug_handler = handlers.TimedRotatingFileHandler( "log/spiderfoot.debug.log", when="d", @@ -150,6 +146,10 @@ def main(): if args.q or args.o == "json": log.setLevel(logging.NOTSET) sfConfig['__logging'] = False + else: + console_handler = logging.StreamHandler(sys.stderr) + console_handler.setFormatter(log_format) + log.addHandler(console_handler) sfModules = dict() sft = SpiderFoot(sfConfig)