diff --git a/tuf/client/updater.py b/tuf/client/updater.py index 2515ef66fb..cf09fe5b16 100755 --- a/tuf/client/updater.py +++ b/tuf/client/updater.py @@ -1151,12 +1151,12 @@ def neither_403_nor_404(mirror_error): # Otherwise, reraise the error, because it is not a simple HTTP # error. if neither_403_nor_404(mirror_error): - logging.exception('Misc error for root version '+str(next_version)) + logger.exception('Misc error for root version '+str(next_version)) raise else: # Calling this function should give us a detailed stack trace # including an HTTP error code, if any. - logging.exception('HTTP error for root version '+str(next_version)) + logger.exception('HTTP error for root version '+str(next_version)) # If we are here, then we ran into only 403 / 404 errors, which are # good reasons to suspect that the next root metadata file does not # exist. diff --git a/tuf/log.py b/tuf/log.py index 9d3612ab36..6a17a18710 100755 --- a/tuf/log.py +++ b/tuf/log.py @@ -118,6 +118,7 @@ # the standard pattern of logging.getLogger(__name__) logger = logging.getLogger('tuf') logger.setLevel(_DEFAULT_LOG_LEVEL) +logger.addHandler(logging.NullHandler()) # Set the built-in file handler. Messages will be logged to # 'settings.LOG_FILENAME', and only those messages with a log level of