Don't hide loggers, especially when it is error

parent c52c2dcb
...@@ -23,6 +23,7 @@ from slapos.libnetworkcache import NetworkcacheClient, UploadError, \ ...@@ -23,6 +23,7 @@ from slapos.libnetworkcache import NetworkcacheClient, UploadError, \
logging.basicConfig() logging.basicConfig()
logger = logging.getLogger('networkcachehelper') logger = logging.getLogger('networkcachehelper')
logger.setLevel(logging.INFO)
def _split_last_directory(path): def _split_last_directory(path):
""" """
...@@ -169,7 +170,7 @@ def helper_download_network_cached(dir_url, cache_url, ...@@ -169,7 +170,7 @@ def helper_download_network_cached(dir_url, cache_url,
logger.warning('Incompatible version of networkcache, not using it.') logger.warning('Incompatible version of networkcache, not using it.')
return False return False
logger.debug('Trying to download %s from network cache...' % directory_key) logger.info('Trying to download %s from network cache...' % directory_key)
try: try:
file_descriptor = None file_descriptor = None
json_entry_list = nc.select_generic(directory_key) json_entry_list = nc.select_generic(directory_key)
...@@ -219,9 +220,9 @@ def helper_download_network_cached(dir_url, cache_url, ...@@ -219,9 +220,9 @@ def helper_download_network_cached(dir_url, cache_url,
except (IOError, DirectoryNotFound), e: except (IOError, DirectoryNotFound), e:
if isinstance(e, urllib2.HTTPError) and e.code == 404: if isinstance(e, urllib2.HTTPError) and e.code == 404:
logger.debug('%s does not exist in network cache.' % directory_key) logger.info('%s does not exist in network cache.' % directory_key)
else: else:
logger.debug('Failed to download from network cache %s: %s' % ( logger.warning('Failed to download from network cache %s: %s' % (
directory_key, str(e))) directory_key, str(e)))
return False return False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment