Пример #1
0
 def _impl(self, *methodArgs, **methodKwargs):
     if issubclass(self.__class__, BaseLogger) and isUILoggingEnabled(
             self.feature):
         parameter = None
         if argsIndex is not None:
             parameter = methodArgs[argsIndex]
         if kwargsKey:
             parameter = methodKwargs.get(kwargsKey, None)
         actionValue = action or parameter
         actionValue = preProcessAction(actionValue)
         valuesMap = argMap
         if argMapSection:
             key = argMapSection() if callable(
                 argMapSection) else argMapSection
             valuesMap = argMap[key]
         if valuesMap:
             if actionValue in valuesMap:
                 actionValue = valuesMap[actionValue]
             else:
                 return method(self, *methodArgs, **methodKwargs)
         self.logStatistic(action=actionValue,
                           resetTime=resetTime,
                           logOnce=logOnce,
                           restrictions=restrictions,
                           validate=validate)
     return method(self, *methodArgs, **methodKwargs)
Пример #2
0
 def _impl(self, *method_args, **method_kwargs):
     if issubclass(self.__class__, BaseLogger) and isUILoggingEnabled(
             self.feature):
         if instanceMethod and valueToCheck is not None:
             if getattr(self, instanceMethod)(valueToCheck):
                 self.logStatistic(action=action,
                                   resetTime=resetTime,
                                   logOnce=logOnce,
                                   restrictions=restrictions,
                                   validate=validate)
     return method(self, *method_args, **method_kwargs)
Пример #3
0
 def _impl(self, *method_args, **method_kwargs):
     if issubclass(self.__class__, BaseLogger) and isUILoggingEnabled(
             self.feature):
         if objProperty:
             actionValue = getattr(self, objProperty)
             if needCall and callable(actionValue):
                 actionValue = actionValue()
             actionValue = postProcessAction(actionValue)
             self.logStatistic(action=actionValue,
                               resetTime=resetTime,
                               logOnce=logOnce,
                               restrictions=restrictions,
                               validate=validate)
     return method(self, *method_args, **method_kwargs)
 def _impl(self, *method_args, **method_kwargs):
     if issubclass(self.__class__, BaseLogger) and isUILoggingEnabled(
             self.feature):
         valuesMap = matches
         if matchesKey:
             key = matchesKey() if callable(matchesKey) else matchesKey
             valuesMap = matches[key]
         if objProperty and valuesMap:
             actionValue = getattr(self, objProperty)
             if actionValue in matches:
                 self.logStatistic(action=matches[actionValue],
                                   resetTime=resetTime,
                                   logOnce=logOnce,
                                   restrictions=restrictions,
                                   validate=validate)
     return method(self, *method_args, **method_kwargs)
Пример #5
0
        def _impl(self, *methodArgs, **methodKwargs):
            if issubclass(self.__class__, BaseLogger) and isUILoggingEnabled(
                    self.feature):
                parameter = methodArgs[argsIndex]
                setting = preProcessAction(parameter)
                try:
                    name, value = setting.items()[0]
                except AttributeError:
                    return method(self, *methodArgs, **methodKwargs)

                if name not in argMap:
                    return method(self, *methodArgs, **methodKwargs)
                self.logStatistic(action=name,
                                  resetTime=False,
                                  logOnce=False,
                                  restrictions=None,
                                  validate=False,
                                  action_value=KEYS_MAPPING.get(value, value))
            return method(self, *methodArgs, **methodKwargs)