From 4a2b4473964ecf0863ae6860e72d54a4f5d8958f Mon Sep 17 00:00:00 2001 From: Sebastjan Date: Fri, 15 Apr 2022 15:07:20 +0200 Subject: [PATCH 1/3] avoid serialisation in logging --- chia/daemon/server.py | 2 +- chia/full_node/weight_proof.py | 2 +- chia/wallet/wallet_node.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chia/daemon/server.py b/chia/daemon/server.py index 014bb2a78259..3079d8ce878f 100644 --- a/chia/daemon/server.py +++ b/chia/daemon/server.py @@ -220,7 +220,7 @@ async def incoming_connection(self, request): while True: msg = await ws.receive() - self.log.debug(f"Received message: {msg}") + self.log.debug("Received message: %s", msg) if msg.type == WSMsgType.TEXT: try: decoded = json.loads(msg.data) diff --git a/chia/full_node/weight_proof.py b/chia/full_node/weight_proof.py index 7756b8e65a80..451499e9615f 100644 --- a/chia/full_node/weight_proof.py +++ b/chia/full_node/weight_proof.py @@ -99,7 +99,7 @@ def get_sub_epoch_data(self, tip_height: uint32, summary_heights: List[uint32]) if ses_height > tip_height: break ses = self.blockchain.get_ses(ses_height) - log.debug(f"handle sub epoch summary {sub_epoch_n} at height: {ses_height} ses {ses}") + log.debug("handle sub epoch summary %s at height: %s ses %s", sub_epoch_n, ses_height, ses) sub_epoch_data.append(_create_sub_epoch_data(ses)) return sub_epoch_data diff --git a/chia/wallet/wallet_node.py b/chia/wallet/wallet_node.py index b64f38cf1a7e..4f6459eb7924 100644 --- a/chia/wallet/wallet_node.py +++ b/chia/wallet/wallet_node.py @@ -358,7 +358,7 @@ async def _process_new_subscriptions(self): try: peer, item = None, None item = await self.new_peak_queue.get() - self.log.debug(f"Pulled from queue: {item}") + self.log.debug("Pulled from queue: %s", item) assert item is not None if item.item_type == NewPeakQueueTypes.COIN_ID_SUBSCRIPTION: # Subscriptions are the highest priority, because we don't want to process any more peaks or From 9c2814003b4715049353b8d313c0ad06360c6555 Mon Sep 17 00:00:00 2001 From: Sebastjan Date: Fri, 15 Apr 2022 15:09:32 +0200 Subject: [PATCH 2/3] avoid serialisation in logging --- chia/daemon/server.py | 2 +- chia/full_node/weight_proof.py | 2 +- chia/wallet/wallet_node.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chia/daemon/server.py b/chia/daemon/server.py index 3079d8ce878f..014bb2a78259 100644 --- a/chia/daemon/server.py +++ b/chia/daemon/server.py @@ -220,7 +220,7 @@ async def incoming_connection(self, request): while True: msg = await ws.receive() - self.log.debug("Received message: %s", msg) + self.log.debug(f"Received message: {msg}") if msg.type == WSMsgType.TEXT: try: decoded = json.loads(msg.data) diff --git a/chia/full_node/weight_proof.py b/chia/full_node/weight_proof.py index 451499e9615f..7756b8e65a80 100644 --- a/chia/full_node/weight_proof.py +++ b/chia/full_node/weight_proof.py @@ -99,7 +99,7 @@ def get_sub_epoch_data(self, tip_height: uint32, summary_heights: List[uint32]) if ses_height > tip_height: break ses = self.blockchain.get_ses(ses_height) - log.debug("handle sub epoch summary %s at height: %s ses %s", sub_epoch_n, ses_height, ses) + log.debug(f"handle sub epoch summary {sub_epoch_n} at height: {ses_height} ses {ses}") sub_epoch_data.append(_create_sub_epoch_data(ses)) return sub_epoch_data diff --git a/chia/wallet/wallet_node.py b/chia/wallet/wallet_node.py index 4f6459eb7924..b64f38cf1a7e 100644 --- a/chia/wallet/wallet_node.py +++ b/chia/wallet/wallet_node.py @@ -358,7 +358,7 @@ async def _process_new_subscriptions(self): try: peer, item = None, None item = await self.new_peak_queue.get() - self.log.debug("Pulled from queue: %s", item) + self.log.debug(f"Pulled from queue: {item}") assert item is not None if item.item_type == NewPeakQueueTypes.COIN_ID_SUBSCRIPTION: # Subscriptions are the highest priority, because we don't want to process any more peaks or From 586a2a4986bd8640e7c1ccddf09278ab385520a7 Mon Sep 17 00:00:00 2001 From: Sebastjan Date: Fri, 15 Apr 2022 15:15:25 +0200 Subject: [PATCH 3/3] Revert "avoid serialisation in logging" This reverts commit 4a2b4473964ecf0863ae6860e72d54a4f5d8958f. --- chia/daemon/server.py | 2 +- chia/full_node/weight_proof.py | 2 +- chia/wallet/wallet_node.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chia/daemon/server.py b/chia/daemon/server.py index 014bb2a78259..3079d8ce878f 100644 --- a/chia/daemon/server.py +++ b/chia/daemon/server.py @@ -220,7 +220,7 @@ async def incoming_connection(self, request): while True: msg = await ws.receive() - self.log.debug(f"Received message: {msg}") + self.log.debug("Received message: %s", msg) if msg.type == WSMsgType.TEXT: try: decoded = json.loads(msg.data) diff --git a/chia/full_node/weight_proof.py b/chia/full_node/weight_proof.py index 7756b8e65a80..451499e9615f 100644 --- a/chia/full_node/weight_proof.py +++ b/chia/full_node/weight_proof.py @@ -99,7 +99,7 @@ def get_sub_epoch_data(self, tip_height: uint32, summary_heights: List[uint32]) if ses_height > tip_height: break ses = self.blockchain.get_ses(ses_height) - log.debug(f"handle sub epoch summary {sub_epoch_n} at height: {ses_height} ses {ses}") + log.debug("handle sub epoch summary %s at height: %s ses %s", sub_epoch_n, ses_height, ses) sub_epoch_data.append(_create_sub_epoch_data(ses)) return sub_epoch_data diff --git a/chia/wallet/wallet_node.py b/chia/wallet/wallet_node.py index b64f38cf1a7e..4f6459eb7924 100644 --- a/chia/wallet/wallet_node.py +++ b/chia/wallet/wallet_node.py @@ -358,7 +358,7 @@ async def _process_new_subscriptions(self): try: peer, item = None, None item = await self.new_peak_queue.get() - self.log.debug(f"Pulled from queue: {item}") + self.log.debug("Pulled from queue: %s", item) assert item is not None if item.item_type == NewPeakQueueTypes.COIN_ID_SUBSCRIPTION: # Subscriptions are the highest priority, because we don't want to process any more peaks or