Skip to content
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
1 change: 1 addition & 0 deletions pubnub/endpoints/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def options(self):
create_status=self.create_status,
create_exception=self.create_exception,
operation_type=self.operation_type(),
operation_name=self.name(),
data=data,
files=self.build_file_upload_request(),
sort_arguments=self._sort_params,
Expand Down
2 changes: 1 addition & 1 deletion pubnub/request_handlers/async_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async def async_request(self, options_func, cancellation_event):
else:
data = "N/A"

logger.debug("[%s %s] %s" % (options.operation_type, response_info.http_version, data))
logger.debug("[%s %s] %s", options.operation_name, response_info.http_version, data)

if response.status not in (200, 307, 204):

Expand Down
2 changes: 1 addition & 1 deletion pubnub/request_handlers/async_httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async def async_request(self, options_func, cancellation_event):
else:
data = "N/A"

logger.debug("[%s %s] %s" % (options.operation_type, response_info.http_version, data))
logger.debug("[%s %s] %s", options.operation_name, response_info.http_version, data)

if response.status_code not in (200, 307, 204):

Expand Down
6 changes: 3 additions & 3 deletions pubnub/request_handlers/httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,13 @@ def _invoke_request(self, p_options, e_options, base_origin):
res = session.request(**args)

try:
logger.debug("[%s %s] %s" % (e_options.operation_type, res.http_version, res.text))
logger.debug("[%s %s] %s", e_options.operation_name, res.http_version, res.text)
except httpx.ResponseNotRead:
content = res.content.decode('utf-8', errors='ignore')
logger.debug("[%s %s] %s" % (e_options.operation_type, res.http_version, content))
logger.debug("[%s %s] %s", e_options.operation_name, res.http_version, content)
except Exception as e:
msg = "(content access failed: %s)" % str(e)
logger.debug("[%s %s] %s" % (e_options.operation_type, res.http_version, msg))
logger.debug("[%s %s] %s", e_options.operation_name, res.http_version, msg)

except httpx.ConnectError as e:
if use_watchdog and self._watchdog.triggered:
Expand Down
2 changes: 1 addition & 1 deletion pubnub/request_handlers/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def _invoke_request(self, p_options, e_options, base_origin):
f"HTTP/{res.raw.version // 10}.{res.raw.version % 10}"
if res.raw and res.raw.version else "unknown"
)
logger.debug("[%s %s] %s" % (e_options.operation_type, http_ver, res.text))
logger.debug("[%s %s] %s", e_options.operation_name, http_ver, res.text)

except requests.exceptions.ConnectionError as e:
raise PubNubException(
Expand Down
4 changes: 3 additions & 1 deletion pubnub/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def __init__(
create_response, create_status, create_exception,
operation_type, data=None, sort_arguments=False,
allow_redirects=True, use_base_path=None, files=None,
request_headers=None, non_json_response=False
request_headers=None, non_json_response=False,
operation_name=None
):
assert len(path) > 0
assert callable(params_callback)
Expand All @@ -35,6 +36,7 @@ def __init__(
self.create_status = create_status
self.create_exception = create_exception
self.operation_type = operation_type
self.operation_name = operation_name
self.allow_redirects = allow_redirects
self.use_base_path = use_base_path
self.request_headers = request_headers
Expand Down
Loading