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
synnefo
Commits
7601acd7
Commit
7601acd7
authored
Aug 08, 2013
by
Sofia Papagiannaki
Browse files
pithos: Fix backend logging.
* Log unicode arguments * Do not log get_block return value (too long)
parent
6b9ca4dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-pithos-backend/pithos/backends/modular.py
View file @
7601acd7
...
...
@@ -133,7 +133,7 @@ def debug_method(func):
result
=
format_exc
()
raise
finally
:
all_args
=
[
str
(
i
)
for
i
in
args
]
all_args
=
map
(
repr
,
args
)
map
(
all_args
.
append
,
(
'%s=%s'
%
(
k
,
v
)
for
k
,
v
in
kw
.
iteritems
()))
logger
.
debug
(
">>> %s(%s) <<< %s"
%
(
func
.
__name__
,
', '
.
join
(
all_args
).
rstrip
(
', '
),
result
))
...
...
@@ -1261,10 +1261,10 @@ class ModularBackend(BaseBackend):
self
.
_can_read
(
user
,
account
,
container
,
name
)
return
(
account
,
container
,
name
)
@
debug_method
def
get_block
(
self
,
hash
):
"""Return a block's data."""
logger
.
debug
(
"get_block: %s"
,
hash
)
block
=
self
.
store
.
block_get
(
binascii
.
unhexlify
(
hash
))
if
not
block
:
raise
ItemNotExists
(
'Block does not exist'
)
...
...
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