Skip to content

Commit

Permalink
Try to cut down on the crazy verbosity of logging (#1036)
Browse files Browse the repository at this point in the history
* Prevent Sphinx from dumping all level=INFO logging output to stdout.

See #1036 for more information.

* Filter out Paramiko logs too, apply filter to all root handlers during testing

* Remove unused import
  • Loading branch information
zachriggle authored Sep 22, 2017
1 parent ebbe917 commit 54c47b3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@
'sphinxcontrib.napoleon'
]

# Disable "info" logging directly to stdout by Sphinx
import logging

class SphinxPwnlibFilter(logging.Filter):
def filter(self, record):
if record.name.startswith('pwn'):
return False
if record.name.startswith('paramiko'):
return False
return True

log_filter = SphinxPwnlibFilter()

for i, handler in enumerate(logging.root.handlers):
print("Filtering Sphinx handler", handler)
handler.addFilter(log_filter)

# Napoleon settings
napoleon_use_ivar = True
napoleon_use_rtype = False
Expand Down

0 comments on commit 54c47b3

Please sign in to comment.