From b010192f8e531f8bb7d41e5f57ea37e0b6136747 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 14 Sep 2016 22:28:59 -0400 Subject: [PATCH] improve logging --- lbrynet/core/client/DownloadManager.py | 2 +- lbrynet/core/log_support.py | 6 ++++++ lbrynet/core/server/BlobRequestHandler.py | 8 ++++---- lbrynet/lbryfile/LBRYFileMetadataManager.py | 2 +- lbrynet/lbryfilemanager/LBRYFileManager.py | 6 +++--- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lbrynet/core/client/DownloadManager.py b/lbrynet/core/client/DownloadManager.py index 265e090eb..1ad132ec9 100644 --- a/lbrynet/core/client/DownloadManager.py +++ b/lbrynet/core/client/DownloadManager.py @@ -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()) diff --git a/lbrynet/core/log_support.py b/lbrynet/core/log_support.py index 04a6fb42d..fcc5dd1c3 100644 --- a/lbrynet/core/log_support.py +++ b/lbrynet/core/log_support.py @@ -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 diff --git a/lbrynet/core/server/BlobRequestHandler.py b/lbrynet/core/server/BlobRequestHandler.py index 36f67d797..51d630951 100644 --- a/lbrynet/core/server/BlobRequestHandler.py +++ b/lbrynet/core/server/BlobRequestHandler.py @@ -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, diff --git a/lbrynet/lbryfile/LBRYFileMetadataManager.py b/lbrynet/lbryfile/LBRYFileMetadataManager.py index 4d389b825..af84024d2 100644 --- a/lbrynet/lbryfile/LBRYFileMetadataManager.py +++ b/lbrynet/lbryfile/LBRYFileMetadataManager.py @@ -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]) diff --git a/lbrynet/lbryfilemanager/LBRYFileManager.py b/lbrynet/lbryfilemanager/LBRYFileManager.py index 22350879e..afde816ea 100644 --- a/lbrynet/lbryfilemanager/LBRYFileManager.py +++ b/lbrynet/lbryfilemanager/LBRYFileManager.py @@ -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: