Martin Sivák has posted comments on this change. Change subject: external scheduler: improve logging ......................................................................
Patch Set 2: Code-Review-1 (2 comments) .................................................... File src/ovirtscheduler/request_handler.py Line 54: """ Line 55: Safely load the user modules in another process Line 56: and find what they implement Line 57: """ Line 58: message_builder = utils.log_message_builder('loadModules', 'Main') Please don't. See my comment in utils.py. Configure the logger with proper formatter instead. Line 59: loaderRunners = [] Line 60: module_files = [] Line 61: for fileName in os.listdir(self._pluginDir): Line 62: module, ext = os.path.splitext(fileName) .................................................... File src/ovirtscheduler/utils.py Line 106: # is the or statement Line 107: return reduce(lambda x, y: x[not pred(y)].append(y) or x, data, ([], [])) Line 108: Line 109: Line 110: class log_message_builder(object): We do not do this in Python. We create a logger that does this for us and then use logger.info/debug/error as usual. So please create a new Formatter class (http://docs.python.org/2/library/logging.html#formatter-objects) and use during the logger initialization. You can then print additional arguments from the LogRecord object using the Formatter: http://docs.python.org/2/library/logging.html#logging.LogRecord Line 111: Line 112: def __init__(self, method, request_id): Line 113: self.method = method Line 114: self.request_id = request_id -- To view, visit http://gerrit.ovirt.org/18789 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2afa5c5c25df3f015cc9a511c0e36185d2bdde12 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-scheduler-proxy Gerrit-Branch: master Gerrit-Owner: Noam Slomianko <nslom...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Noam Slomianko <nslom...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches