Skip to content

Commit 339319a

Browse files
committed
feat: tune logging verbosity
1 parent 9216be4 commit 339319a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

wherobots/db/connection.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ def cursor(self) -> Cursor:
7676

7777
def __main_loop(self):
7878
"""Main background loop listening for messages from the SQL session."""
79-
logging.debug("Starting background connection handling loop...")
79+
logging.info("Starting background connection handling loop...")
8080
while self.__ws.protocol.state < websockets.protocol.State.CLOSING:
8181
try:
8282
self.__listen()
8383
except websockets.exceptions.ConnectionClosedOK:
84-
logging.debug("Connection closed; stopping main loop.")
84+
logging.info("Connection closed; stopping main loop.")
8585
return
8686
except Exception as e:
8787
logging.exception("Error handling message from SQL session", exc_info=e)
@@ -157,7 +157,6 @@ def __listen(self):
157157
logging.warning("Received unknown %s event!", kind)
158158

159159
def __send(self, message: dict[str, Any]) -> None:
160-
logging.debug("Sending %s", message)
161160
self.__ws.send(json.dumps(message))
162161

163162
def __recv(self) -> dict[str, Any]:
@@ -168,7 +167,6 @@ def __recv(self) -> dict[str, Any]:
168167
message = cbor2.loads(frame)
169168
else:
170169
raise ValueError("Unexpected frame type received")
171-
logging.debug("Received message: %s", message)
172170
return message
173171

174172
def __execute_sql(self, sql: str, handler: Callable[[Any], None]) -> str:
@@ -194,7 +192,6 @@ def __request_results(self, execution_id: str) -> None:
194192
if not query:
195193
return
196194

197-
# TODO: Switch to Arrow encoding of results when supported.
198195
request = {
199196
"kind": RequestKind.RETRIEVE_RESULTS.value,
200197
"execution_id": execution_id,

0 commit comments

Comments
 (0)