From 087e68eb0bbb298454c2488013a47ddb9abef715 Mon Sep 17 00:00:00 2001 From: Jonathan Zernik Date: Sun, 2 Aug 2020 23:11:06 -0700 Subject: [PATCH] Change sqkserver log level in docker (#210) --- docker/sqkserver/start-sqkserver.sh | 2 +- squeakserver/blockchain/bitcoin_blockchain_client.py | 12 ++++++------ squeakserver/node/squeak_subscription_downloader.py | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docker/sqkserver/start-sqkserver.sh b/docker/sqkserver/start-sqkserver.sh index dfa3fc23..6c74acc7 100644 --- a/docker/sqkserver/start-sqkserver.sh +++ b/docker/sqkserver/start-sqkserver.sh @@ -14,5 +14,5 @@ export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt exec runsqueakserver \ --config config.ini \ - --log-level DEBUG \ + --log-level INFO \ run-server diff --git a/squeakserver/blockchain/bitcoin_blockchain_client.py b/squeakserver/blockchain/bitcoin_blockchain_client.py index 436c19f7..5dd3b736 100644 --- a/squeakserver/blockchain/bitcoin_blockchain_client.py +++ b/squeakserver/blockchain/bitcoin_blockchain_client.py @@ -37,10 +37,10 @@ class BitcoinBlockchainClient(BlockchainClient): self.url, data=json.dumps(payload), headers=self.headers, ).json() - logger.info("Got response for get_block_count: {}".format(response)) + logger.debug("Got response for get_block_count: {}".format(response)) result = response["result"] block_count = int(result) - logger.info("Got block_count: {}".format(block_count)) + logger.debug("Got block_count: {}".format(block_count)) return block_count def get_block_hash(self, block_height: int) -> Optional[str]: @@ -54,10 +54,10 @@ class BitcoinBlockchainClient(BlockchainClient): self.url, data=json.dumps(payload), headers=self.headers, ).json() - logger.info("Got response for get_block_hash: {}".format(response)) + logger.debug("Got response for get_block_hash: {}".format(response)) result = response["result"] block_hash = result - logger.info("Got block_hash: {}".format(block_hash)) + logger.debug("Got block_hash: {}".format(block_hash)) return block_hash # def get_best_block_hash(self) -> Optional[bytes]: @@ -86,7 +86,7 @@ class BitcoinBlockchainClient(BlockchainClient): self.url, data=json.dumps(payload), headers=self.headers, ).json() - logger.info("Got response for get_block_header: {}".format(response)) + logger.debug("Got response for get_block_header: {}".format(response)) result = response["result"] - logger.info("Got block_header: {}".format(result)) + logger.debug("Got block_header: {}".format(result)) return result diff --git a/squeakserver/node/squeak_subscription_downloader.py b/squeakserver/node/squeak_subscription_downloader.py index d36e097b..34491e07 100644 --- a/squeakserver/node/squeak_subscription_downloader.py +++ b/squeakserver/node/squeak_subscription_downloader.py @@ -32,7 +32,8 @@ class SqueakSubscriptionDownloader: return for subscription in subscriptions: - logger.info("Syncing subscription: {} with current block: {}".format(subscription, block_height)) + if subscription.subscribed: + logger.info("Syncing subscription: {} with current block: {}".format(subscription, block_height)) def start_running(self): threading.Timer(self.update_interval_s, self.start_running).start()