mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Shortening post parameters when debugging.
This commit is contained in:
parent
4170505f1e
commit
45846d0d59
1 changed files with 4 additions and 1 deletions
|
@ -12,7 +12,10 @@ class DumpRequestMiddleware:
|
|||
request_data = request.POST or request.GET
|
||||
request_items = dict(request_data).items()
|
||||
if request_items:
|
||||
logging.debug(" ---> ~FC%s ~SN~FK~BC%s~BT~ST ~FC%s~BK~FC" % (request.method, request.path, dict(request_items)))
|
||||
request_items_str = f"{dict(request_items)}"
|
||||
if len(request_items_str) > 200:
|
||||
request_items_str = request_items_str[:100] + "...[" + str(len(request_items_str)-200) + " bytes]..." + request_items_str[-100:]
|
||||
logging.debug(" ---> ~FC%s ~SN~FK~BC%s~BT~ST ~FC%s~BK~FC" % (request.method, request.path, request_items_str))
|
||||
else:
|
||||
logging.debug(" ---> ~FC%s ~SN~FK~BC%s~BT~ST" % (request.method, request.path))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue