Same line logs

When logging, headers, url, method, etc, were in different lines
making it hard to distinguish what belonged to the same request
or response. This puts everything in the same line.

Change-Id: I9aa8ce64fa98a13d5d26f80f4e690f2a8eda847b
This commit is contained in:
Kristi Nikolla 2018-06-15 18:06:05 -04:00
parent 61a8444c27
commit 39e4c36344
1 changed files with 4 additions and 4 deletions

View File

@ -64,10 +64,10 @@ def strip_tokens_from_headers(headers):
def format_for_log(title=None, method=None, url=None, headers=None,
status_code=None):
return ''.join([
'{}:\n'.format(title) if title else '',
'Method: {}\n'.format(method) if method else '',
'URL: {}\n'.format(url) if url else '',
'Headers: {}\n'.format(
'{}: '.format(title) if title else '',
'Method: {}, '.format(method) if method else '',
'URL: {}, '.format(url) if url else '',
'Headers: {}, '.format(
strip_tokens_from_headers(headers)) if headers else '',
'Status Code: {}\n'.format(status_code) if status_code else ''
])