Skip to content

Commit

Permalink
Merge pull request #985 from blacklanternsecurity/log-command
Browse files Browse the repository at this point in the history
Always log scan command
  • Loading branch information
TheTechromancer authored Jan 11, 2024
2 parents ef1983a + 6f81c9c commit 60f5993
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions bbot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ async def _main():
await scanner._prep()

if not options.dry_run:
log.trace(f"Command: {' '.join(sys.argv)}")
if not options.agent_mode and not options.yes and sys.stdin.isatty():
log.hugesuccess(f"Scan ready. Press enter to execute {scanner.name}")
input()
Expand Down
5 changes: 4 additions & 1 deletion bbot/core/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ def stderr_filter(record):
# Log to stdout
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.addFilter(lambda x: x.levelno == logging.STDOUT)
debug_handler.addFilter(lambda x: x.levelno != logging.STDOUT and x.levelno >= logging.DEBUG)
# log to files
debug_handler.addFilter(
lambda x: x.levelno == logging.TRACE or (x.levelno < logging.VERBOSE and x.levelno != logging.STDOUT)
)
main_handler.addFilter(
lambda x: x.levelno not in (logging.STDOUT, logging.TRACE) and x.levelno >= logging.VERBOSE
)
Expand Down

0 comments on commit 60f5993

Please sign in to comment.