Skip to content

Commit eaa7edd

Browse files
committed
improve logging
1 parent 4f5d299 commit eaa7edd

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

py_boilingdata/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
class BoilingData:
3939
"""Run SQL with BoilingData and local DuckDB"""
4040

41-
def __init__(self, log_level=logging.DEBUG):
41+
def __init__(self, log_level=logging.INFO):
4242
logging.basicConfig()
4343
self.log_level = log_level
4444
self.logger = logging.getLogger("BoilingData")
@@ -116,7 +116,7 @@ async def execute(self, sql, cb=None, force_boiling=False):
116116
class BoilingDataConnection:
117117
"""Create authenticated WebSocket connection to BoilingData"""
118118

119-
def __init__(self, region=AWS_REGION, log_level=logging.ERROR):
119+
def __init__(self, region=AWS_REGION, log_level=logging.INFO):
120120
self.log_level = log_level
121121
self.logger = logging.getLogger("BoilingDataConnection")
122122
self.logger.setLevel(self.log_level)
@@ -207,6 +207,13 @@ def _on_msg(self, ws_app, data):
207207
log_level = msg.get("logLevel")
208208
if log_level == "ERROR":
209209
raise Exception(msg.get("logMessage"))
210+
if log_level == "INFO":
211+
self.logger.info(msg.get("logMessage"))
212+
if msg_type == "INFO" and self.log_level == "INFO":
213+
self.logger.info(msg.get("info"))
214+
if msg_type == "LAMBDA_EVENT":
215+
lambda_event = msg.get("lambdaEvent")
216+
self.logger.info(lambda_event)
210217
if msg_type != "DATA":
211218
return
212219
req = self.requests.get(reqId)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ asyncio_mode = "auto"
33

44
[tool.poetry]
55
name = "py-boilingdata"
6-
version = "0.2.4"
6+
version = "0.2.5"
77
description = "BoilingData (websockets) client for Python"
88
authors = ["Dan Forsberg <dan@boilingdata.com>"]
99
readme = "README.md"

0 commit comments

Comments
 (0)