Saggi Mizrahi has posted comments on this change.
Change subject: Made the logging mechanism more generic
......................................................................
Patch Set 2: (4 inline comments)
....................................................
File vdsm/logUtils.py
Line 29:
Line 30: return func.func_name
Line 31:
Line 32: def logcall(loggerName, pattern="%s", loglevel=logging.INFO,
printers={}, resPrinter=repr, resPattern="%(name)s->%(result)s"):
Line 33: def phase2(f):
You are wrong
Line 34: @wraps(f)
Line 35: def wrapper(*args, **kwargs):
Line 36: logger = logging.getLogger(loggerName)
Line 37: logger.log(loglevel, pattern % (call2str(f, args, kwargs,
printers),))
Line 46: def call2str(func, args, kwargs, printers={}):
Line 47: kwargs = kwargs.copy()
Line 48: varnames = func.func_code.co_varnames[:func.func_code.co_argcount]
Line 49: if hasattr(func, "im_func"):
Line 50: args = [func.im_self] + list(args)
I would have to account for the arg missing at every turn. I still disagree
Line 51: func = func.im_func
Line 52:
Line 53: for name, val in zip(varnames, args):
Line 54: kwargs[name] = val
....................................................
File vdsm/storage/hsm.py
Line 1574: #getSharedLock(connectionsResource...)
Line 1575: return dict(info=self.__getVGsInfo([vgUUID])[0])
Line 1576:
Line 1577: @staticmethod
Line 1578: @logged()
what?
Line 1579: def public_discoverSendTargets(con, options = None):
Line 1580: """
Line 1581: Discovers iSCSI targets.
Line 1582:
....................................................
File vdsm/storage/spm.py
Line 56: from processPool import Timeout
Line 57: import logUtils
Line 58:
Line 59: logged = partial(logUtils.logcall, "dispatcher", "Run and protect: %s",
Line 60: resPattern="Run and protect: %(name)s, Return response:
%(result)s")
This file will be removed in about 3 patches. The duplication is here because
this file is an abomination
Line 61:
Line 62: rmanager = rm.ResourceManager.getInstance()
Line 63:
Line 64: # Global operation definitions
--
To view, visit http://gerrit.usersys.redhat.com/990
To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I38b4a16803b03043144acf62e9fb65c3b1b0a3c5
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/vdsm-patches