summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristi Nikolla <kristi@nikolla.me>2018-06-15 18:06:05 -0400
committerKristi Nikolla <kristi@nikolla.me>2018-06-15 18:09:04 -0400
commit39e4c3634477723790ca4aad57eab5e6b7f34703 (patch)
treee97fee48e0f0b150ba8996b7c2fce0f35cd24a5b
parent61a8444c27a5c5fbc368ac88331124e8ff219cad (diff)
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
Notes
Notes (review): Code-Review+2: Jeremy Freudberg <jeremyfreudberg@gmail.com> Workflow+1: Kristi Nikolla <kristi@nikolla.me> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 18 Jun 2018 19:25:42 +0000 Reviewed-on: https://review.openstack.org/575861 Project: openstack/mixmatch Branch: refs/heads/master
-rw-r--r--mixmatch/proxy.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mixmatch/proxy.py b/mixmatch/proxy.py
index 2001997..4e56b8a 100644
--- a/mixmatch/proxy.py
+++ b/mixmatch/proxy.py
@@ -64,10 +64,10 @@ def strip_tokens_from_headers(headers):
64def format_for_log(title=None, method=None, url=None, headers=None, 64def format_for_log(title=None, method=None, url=None, headers=None,
65 status_code=None): 65 status_code=None):
66 return ''.join([ 66 return ''.join([
67 '{}:\n'.format(title) if title else '', 67 '{}: '.format(title) if title else '',
68 'Method: {}\n'.format(method) if method else '', 68 'Method: {}, '.format(method) if method else '',
69 'URL: {}\n'.format(url) if url else '', 69 'URL: {}, '.format(url) if url else '',
70 'Headers: {}\n'.format( 70 'Headers: {}, '.format(
71 strip_tokens_from_headers(headers)) if headers else '', 71 strip_tokens_from_headers(headers)) if headers else '',
72 'Status Code: {}\n'.format(status_code) if status_code else '' 72 'Status Code: {}\n'.format(status_code) if status_code else ''
73 ]) 73 ])