add DEBUG logs
This commit is contained in:
parent
0fc26d096f
commit
39f0153f9b
3 changed files with 43 additions and 10 deletions
|
|
@ -91,9 +91,11 @@ class NostrClient:
|
|||
self.subscription_id = "nostrmarket-" + urlsafe_short_hash()[:32]
|
||||
await self.send_req_queue.put(["REQ", self.subscription_id] + merchant_filters)
|
||||
|
||||
logger.debug(
|
||||
f"Subscribing to events for: {len(public_keys)} keys. New subscription id: {self.subscription_id}"
|
||||
logger.info(
|
||||
f"[NOSTRMARKET DEBUG] Subscribing to events for: {len(public_keys)} keys. New subscription id: {self.subscription_id}"
|
||||
)
|
||||
logger.info(f"[NOSTRMARKET DEBUG] Subscription filters: {merchant_filters}")
|
||||
logger.info(f"[NOSTRMARKET DEBUG] Public keys: {public_keys}")
|
||||
|
||||
async def merchant_temp_subscription(self, pk, duration=10):
|
||||
dm_filters = self._filters_for_direct_messages([pk], 0)
|
||||
|
|
@ -175,16 +177,17 @@ class NostrClient:
|
|||
|
||||
def _ws_handlers(self):
|
||||
def on_open(_):
|
||||
logger.info("Connected to 'nostrclient' websocket")
|
||||
logger.info("[NOSTRMARKET DEBUG] Connected to 'nostrclient' websocket")
|
||||
|
||||
def on_message(_, message):
|
||||
logger.info(f"[NOSTRMARKET DEBUG] Received websocket message: {message[:200]}...")
|
||||
self.recieve_event_queue.put_nowait(message)
|
||||
|
||||
def on_error(_, error):
|
||||
logger.warning(error)
|
||||
logger.warning(f"[NOSTRMARKET DEBUG] Websocket error: {error}")
|
||||
|
||||
def on_close(x, status_code, message):
|
||||
logger.warning(f"Websocket closed: {x}: '{status_code}' '{message}'")
|
||||
logger.warning(f"[NOSTRMARKET DEBUG] Websocket closed: {x}: '{status_code}' '{message}'")
|
||||
# force re-subscribe
|
||||
self.recieve_event_queue.put_nowait(ValueError("Websocket close."))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue