Skip to content

Commit

Permalink
sf.py: Respect -q option to hide logging from stderr.
Browse files Browse the repository at this point in the history
  • Loading branch information
smicallef committed Aug 15, 2021
1 parent de9734f commit 72092bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 72092bc

Please sign in to comment.