#1014 backend: once more redis logger + exceptions
Merged 4 years ago by praiskup. Opened 4 years ago by praiskup.

@@ -393,6 +393,10 @@

          # 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.

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.

rebased onto d4fda3e

4 years ago

Metadata Update from @msuchy:
- Pull-request tagged with: can-be-merged

4 years ago

Commit 69a4efc fixes this pull-request

Pull-Request has been merged by praiskup

4 years ago