Add filter to paramiko and iso8601 logs

Add filter to suppress debug logs from paramiko and iso8601 modules

Change-Id: I730ee4ede5e82ede0b44ec1f966d03c05c091804
Closes-bug: #1491007
This commit is contained in:
Dmitry Tyzhnenko 2015-09-01 17:23:19 +03:00
parent c2cb46ff09
commit 311d8f072b

View File

@ -36,6 +36,16 @@ logger = logging.getLogger(__name__)
logger.addHandler(console)
# suppress iso8601 and paramiko debug logging
class NoDebugMessageFilter(logging.Filter):
def filter(self, record):
return not record.levelno <= logging.DEBUG
logging.getLogger('paramiko.transport').addFilter(NoDebugMessageFilter())
logging.getLogger('paramiko.hostkeys').addFilter(NoDebugMessageFilter())
logging.getLogger('iso8601.iso8601').addFilter(NoDebugMessageFilter())
def debug(logger):
def wrapper(func):
@functools.wraps(func)