Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit e09b075

Browse files
committed
debug messages line lenght needs to be longer so that error return messages are shown clearly
1 parent 3b8e699 commit e09b075

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CloudFlare/cloudflare.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ def _call_network(self, method, headers, parts, identifiers, params, data_str, d
311311

312312
if self.logger:
313313
if 'text/' == response_type[0:5] or response_type in ['application/javascript', 'application/json']:
314-
if len(response_data) > 100:
315-
self.logger.debug('Response: %d, %s, %s...', response_code, response_type, response_data[0:100])
314+
if len(response_data) > 180:
315+
self.logger.debug('Response: %d, %s, %s...', response_code, response_type, response_data[0:180])
316316
else:
317317
self.logger.debug('Response: %d, %s, %s', response_code, response_type, response_data)
318318
else:
@@ -604,12 +604,12 @@ def _call(self, method, parts, identifiers, params, data_str, data_json, files):
604604

605605
if self.logger:
606606
if isinstance(result, (str, dict, list)):
607-
if len(str(result)) > 100:
608-
self.logger.debug('Response: %s...', str(result)[0:100].replace('\n', ' '))
607+
if len(str(result)) > 180:
608+
self.logger.debug('Response: %s...', str(result)[0:180].replace('\n', ' '))
609609
else:
610610
self.logger.debug('Response: %s', str(result).replace('\n', ' '))
611611
elif isinstance(result, (bytes,bytearray)):
612-
self.logger.debug('Response: %s', result[0:100])
612+
self.logger.debug('Response: %s', result[0:180])
613613
else:
614614
self.logger.debug('Response: %s', '...')
615615
return result

CloudFlare/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def build_curl(method, url, headers, params, data_str, data_json, files):
5555
# data_str
5656
if data_str is not None:
5757
if isinstance(data_str, (bytes,bytearray)):
58-
if len(data_str) > 100:
59-
msg.append(' --data-binary \'%s ...\' \\' % (str(data_str[0:100]).replace('\n', '\n')))
58+
if len(data_str) > 180:
59+
msg.append(' --data-binary \'%s ...\' \\' % (str(data_str[0:180]).replace('\n', '\n')))
6060
else:
6161
msg.append(' --data-binary \'%s\' \\' % (str(data_str).replace('\n', '\n')))
6262
else:
63-
if len(data_str) > 100:
64-
msg.append(' --data \'%s ...\' \\' % (str(data_str[0:100]).replace('\n', ' ')))
63+
if len(data_str) > 180:
64+
msg.append(' --data \'%s ...\' \\' % (str(data_str[0:180]).replace('\n', ' ')))
6565
else:
6666
msg.append(' --data \'%s\' \\' % (str(data_str).replace('\n', ' ')))
6767
# data_json
@@ -70,8 +70,8 @@ def build_curl(method, url, headers, params, data_str, data_json, files):
7070
s = json.dumps(data_json)
7171
except (TypeError, ValueError, RecursionError):
7272
s = str(data_json)
73-
if len(s) > 100:
74-
msg.append(' --data \'%s ...\' \\' % (s[0:100].replace('\n', ' ')))
73+
if len(s) > 180:
74+
msg.append(' --data \'%s ...\' \\' % (s[0:180].replace('\n', ' ')))
7575
else:
7676
msg.append(' --data \'%s\' \\' % (s.replace('\n', ' ')))
7777
# files

0 commit comments

Comments
 (0)