This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push: new 69a4efc backend: once more redis logger + exceptions 69a4efc is described below
commit 69a4efce238ec812324bda0599e8288d8d3e4c05 Author: Pavel Raiskup praiskup@redhat.com AuthorDate: Wed Sep 18 20:46:16 2019 +0200
backend: once more redis logger + exceptions
The RedisPublishHandler expands 'logrecord.msg % logrecord.args', but we use 'log.exception(ex)' idiom on many places in backend code - and the '%' operator doesn't convert the left operand automatically.
Merges: #1014 --- backend/backend/helpers.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/backend/backend/helpers.py b/backend/backend/helpers.py index 451fb50..096d276 100644 --- a/backend/backend/helpers.py +++ b/backend/backend/helpers.py @@ -393,6 +393,10 @@ class RedisPublishHandler(logging.Handler): # copr specific semantics record.who = self.who
+ # First argument to 'log.exception()' should be 'str' type. If it is + # not, we need to convert it before using '%' operator below. + record.msg = str(record.msg) + # For the message arguments, it is better to expand them right now # instead of relying on method in json.dumps(..., default=default) # and even worse rely on it's reverse action in RedisLogHandler.
copr-commits@lists.fedorahosted.org