Yaniv Bronhaim has posted comments on this change.

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


Patch Set 4: Code-Review+1

(2 comments)

acked, but added my thoughts.

https://gerrit.ovirt.org/#/c/47522/4/lib/yajsonrpc/betterAsyncore.py
File lib/yajsonrpc/betterAsyncore.py:

Line 137:     # Override asyncore.dispatcher logging to use our logger
Line 138:     log = _log.debug
Line 139: 
Line 140:     def log_info(self, message, type='info'):
Line 141:         level = getattr(logging, type.upper(), None)
I would map the type to our logger types instead of this check
Line 142:         if not isinstance(level, int):
Line 143:             raise ValueError('Invalid log level: %s' % type)
Line 144:         self._log.log(level, message)
Line 145: 


Line 140:     def log_info(self, message, type='info'):
Line 141:         level = getattr(logging, type.upper(), None)
Line 142:         if not isinstance(level, int):
Line 143:             raise ValueError('Invalid log level: %s' % type)
Line 144:         self._log.log(level, message)
there are also ignore levels that you might want to consider 
from dispatcher impl:

    def log_info(self, message, type='info'):                                   
        if type not in self.ignore_log_types:                                   
            print '%s: %s' % (type, message)

but if you prefer to use our logger.conf restriction its fine
Line 145: 
Line 146: 
Line 147: class AsyncoreEvent(asyncore.file_dispatcher):
Line 148:     def __init__(self, map=None):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2396d1ec98987064134af334ff0a2a4dab78d836
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to