Skip to content

Commit 59a3b99

Browse files
committed
Change a few log Levels here and there...
1 parent 6c19bcd commit 59a3b99

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pygqlc/GraphQLClient.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def unsubscribe():
447447
def _unsubscribe(self, _id):
448448
sub = self.subs.get(_id)
449449
if not sub:
450-
log(LogLevel.INFO, 'Subscription already cleared')
450+
log(LogLevel.WARNING, 'Subscription already cleared')
451451
return
452452
self.unsubscribing = True
453453
sub['kill'] = True
@@ -460,7 +460,7 @@ def _unsubscribe(self, _id):
460460
self.unsubscribing = False
461461

462462
def _sub_routing_loop(self):
463-
log(LogLevel.INFO, 'first subscription, starting routing loop')
463+
log(LogLevel.SUCCESS, 'first subscription, starting routing loop')
464464
last_reconnect_attempt = 0
465465
reconnect_delay = 1.0
466466

@@ -469,10 +469,11 @@ def _sub_routing_loop(self):
469469
# Rate limit reconnection attempts
470470
current_time = time.time()
471471
if current_time - last_reconnect_attempt >= reconnect_delay:
472-
log(LogLevel.INFO, 'Connection halted, attempting reconnection...')
472+
log(LogLevel.WARNING,
473+
'Connection halted, attempting reconnection...')
473474
if self._new_conn():
474475
self.wss_conn_halted = False
475-
log(LogLevel.INFO,
476+
log(LogLevel.SUCCESS,
476477
'WSS Reconnection succeeded, attempting resubscription to lost subs')
477478
self._resubscribe_all()
478479
log(LogLevel.INFO, 'finished resubscriptions')
@@ -968,7 +969,7 @@ def execute(self, query: str, variables: dict | None = None) -> dict:
968969
headers=headers,
969970
timeout=float(env.get('post_timeout', 60))
970971
)
971-
except Exception as e:
972+
except Exception as _e:
972973
# If connection fails, create a new client and retry
973974
self._thread_local.client = httpx.Client(**self.client_params)
974975
client = self._thread_local.client

0 commit comments

Comments
 (0)