Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
kamaki
Commits
054e60c0
Commit
054e60c0
authored
Oct 03, 2011
by
Giorgos Verigakis
Browse files
Improve logging output
parent
9a3f4ffc
Changes
1
Hide whitespace changes
Inline
Side-by-side
kamaki/client.py
View file @
054e60c0
...
...
@@ -80,26 +80,27 @@ class Client(object):
headers
[
'Content-Type'
]
=
'application/json'
headers
[
'Content-Length'
]
=
len
(
body
)
log
.
debug
(
'%s'
,
'>'
*
4
0
)
log
.
debug
(
'>'
*
5
0
)
log
.
debug
(
'%s %s'
,
method
,
path
)
for
key
,
val
in
headers
.
items
():
log
.
debug
(
'%s: %s'
,
key
,
val
)
log
.
debug
(
''
)
if
body
:
log
.
debug
(
body
)
log
.
debug
(
''
)
log
.
debug
(
body
)
conn
.
request
(
method
,
path
,
body
,
headers
)
resp
=
conn
.
getresponse
()
log
.
debug
(
'%s'
,
'<'
*
40
)
buf
=
resp
.
read
()
log
.
debug
(
'<'
*
50
)
log
.
info
(
'%d %s'
,
resp
.
status
,
resp
.
reason
)
for
key
,
val
in
resp
.
getheaders
():
log
.
info
(
'%s: %s'
,
key
.
capitalize
(),
val
)
log
.
info
(
''
)
log
.
debug
(
buf
)
log
.
debug
(
'-'
*
50
)
buf
=
resp
.
read
()
try
:
reply
=
json
.
loads
(
buf
)
if
buf
else
{}
except
ValueError
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment