Piotr Kliczewski has uploaded a new change for review.

Change subject: log: failure in logging
......................................................................

log: failure in logging

We need to reimplement log_info method since it has a bit different
signature than log method and with previous approach it fails with:

TypeError: not all arguments converted during string formatting


Change-Id: I2396d1ec98987064134af334ff0a2a4dab78d836
Signed-off-by: pkliczewski <[email protected]>
---
M lib/yajsonrpc/betterAsyncore.py
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/47522/1

diff --git a/lib/yajsonrpc/betterAsyncore.py b/lib/yajsonrpc/betterAsyncore.py
index 0f0e9fc..270fc04 100644
--- a/lib/yajsonrpc/betterAsyncore.py
+++ b/lib/yajsonrpc/betterAsyncore.py
@@ -134,9 +134,11 @@
         else:
             return getattr(asyncore.dispatcher, name)(self)
 
-    # Override asyncore.dispatcher logging to use our logger
-    log = _log.debug
-    log_info = _log.info
+    def log_info(self, message, type='info'):
+        level = getattr(logging, type.upper(), None)
+        if not isinstance(level, int):
+            raise ValueError('Invalid log level: %s' % type)
+        self.log.log(level, message)
 
 
 class AsyncoreEvent(asyncore.file_dispatcher):


-- 
To view, visit https://gerrit.ovirt.org/47522
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2396d1ec98987064134af334ff0a2a4dab78d836
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to