Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log optimizations #117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration_tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def wait_for_presto_coordinator(stream, timeout=30):
time.sleep(5)
return True
if time.time() - t0 > timeout:
logger.error("coordinator took longer than {} to start".format(timeout))
logger.error("coordinator took longer than %s to start", timeout)
raise TimeoutError
return False

Expand Down
2 changes: 1 addition & 1 deletion prestodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
from . import exceptions
from . import logging

__version__ = "0.8.2"
__version__ = "0.8.3"
8 changes: 3 additions & 5 deletions prestodb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,8 @@ def post(self, sql):
while http_response is not None and http_response.is_redirect:
location = http_response.headers["Location"]
url = self._redirect_handler.handle(location)
logger.info(
"redirect {} from {} to {}".format(
logger.info("redirect % from % to %",
http_response.status_code, location, url
)
)
http_response = self._post(
url,
Expand Down Expand Up @@ -412,7 +410,7 @@ def process(self, http_response):

http_response.encoding = "utf-8"
response = http_response.json()
logger.debug("HTTP {}: {}".format(http_response.status_code, response))
logger.debug("HTTP %s: %s", http_response.status_code, response)
if "error" in response:
raise self._process_error(response["error"], response.get("id"))

Expand Down Expand Up @@ -482,7 +480,7 @@ def __iter__(self):
rows = self._query.fetch()
for row in rows:
self._rownumber += 1
logger.debug("row {}".format(row))
logger.debug("row %s", row)
yield row


Expand Down
2 changes: 1 addition & 1 deletion prestodb/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def decorated(*args, **kwargs):
handle_retry.retry(func, args, kwargs, err, attempt)
continue
break
logger.info("failed after {} attempts".format(attempt))
logger.info("failed after %s attempts", attempt)
if error is not None:
raise error
return result
Expand Down
2 changes: 1 addition & 1 deletion prestodb/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def begin(self):
self._id = response.headers[constants.HEADER_STARTED_TRANSACTION]
status = self._request.process(response)
self._request.transaction_id = self._id
logger.info("transaction started: " + self._id)
logger.info("transaction started: %s", self._id)

def commit(self):
query = prestodb.client.PrestoQuery(self._request, COMMIT)
Expand Down