improve logging

This commit is contained in:
Jack 2016-09-14 22:28:59 -04:00
parent 2b1af8eea2
commit b010192f8e
5 changed files with 15 additions and 9 deletions

View file

@ -70,7 +70,7 @@ class DownloadManager(object):
def add_blob_to_list(blob, blob_num):
self.blobs[blob_num] = blob
log.info("Added blob (hash: %s, number %s) to the list", str(blob.blob_hash), str(blob_num))
log.debug("Added blob (hash: %s, number %s) to the list", str(blob.blob_hash), str(blob_num))
def error_during_add(err):
log.warning("An error occurred adding the blob to blobs. Error:%s", err.getErrorMessage())

View file

@ -86,6 +86,12 @@ def disable_noisy_loggers():
logging.getLogger('lbrynet.core.server.BlobAvailabilityHandler').setLevel(logging.INFO)
logging.getLogger('lbrynet.dht').setLevel(logging.INFO)
logging.getLogger('lbrynet.lbrynet_daemon.LBRYExchangeRateManager').setLevel(logging.INFO)
logging.getLogger('lbrynet.lbrynet_daemon.LBRYDaemon').setLevel(logging.INFO)
logging.getLogger('lbrynet.core.LBRYWallet').setLevel(logging.INFO)
logging.getLogger('lbrynet.lbryfile.LBRYFileMetadataManager').setLevel(logging.INFO)
logging.getLogger('lbrynet.core.client.DownloadManager').setLevel(logging.INFO)
logging.getLogger('lbrynet.lbryfilemanager.LBRYFileManager').setLevel(logging.INFO)
logging.getLogger('lbrynet.core.server.BlobRequestHandler').setLevel(logging.INFO)
@_log_decorator

View file

@ -78,11 +78,11 @@ class BlobRequestHandler(object):
if read_handle is not None:
self.currently_uploading = blob
self.read_handle = read_handle
log.debug("Sending %s to client", str(blob))
log.info("Sending %s to client", str(blob))
response_fields['blob_hash'] = blob.blob_hash
response_fields['length'] = blob.length
return response
log.debug("We can not send %s", str(blob))
log.warning("We can not send %s", str(blob))
response_fields['error'] = "BLOB_UNAVAILABLE"
return response
@ -132,13 +132,13 @@ class BlobRequestHandler(object):
def start_transfer():
self.file_sender = FileSender()
log.info("Starting the file upload")
log.debug("Starting the file upload")
assert self.read_handle is not None, "self.read_handle was None when trying to start the transfer"
d = self.file_sender.beginFileTransfer(self.read_handle, consumer, count_bytes)
return d
def set_expected_payment():
log.info("Setting expected payment")
log.debug("Setting expected payment")
if self.blob_bytes_uploaded != 0 and self.blob_data_payment_rate is not None:
# TODO: explain why 2**20
self.wallet.add_expected_payment(self.peer,

View file

@ -236,7 +236,7 @@ class DBLBRYFileMetadataManager(object):
@rerun_if_locked
def _get_sd_blob_hashes_for_stream(self, stream_hash):
log.info("Looking up sd blob hashes for stream hash %s", str(stream_hash))
log.debug("Looking up sd blob hashes for stream hash %s", str(stream_hash))
d = self.db_conn.runQuery("select sd_blob_hash from lbry_file_descriptors where stream_hash = ?",
(stream_hash,))
d.addCallback(lambda results: [r[0] for r in results])

View file

@ -82,9 +82,9 @@ class LBRYFileManager(object):
def log_error(err, rowid, stream_hash, options):
log.error("An error occurred while starting a lbry file: %s", err.getErrorMessage())
log.error(rowid)
log.error(stream_hash)
log.error(options)
log.debug(rowid)
log.debug(stream_hash)
log.debug(options)
def start_lbry_files(lbry_files_and_options):
for rowid, stream_hash, options in lbry_files_and_options: