Monitor the arguments of a function. Parameters: function (function): function to monitor Returns: function: wrapped function
(self, function)
| 167 | return wrapper |
| 168 | |
| 169 | def call(self, function): |
| 170 | """ |
| 171 | Monitor the arguments of a function. |
| 172 | |
| 173 | Parameters: |
| 174 | function (function): function to monitor |
| 175 | |
| 176 | Returns: |
| 177 | function: wrapped function |
| 178 | """ |
| 179 | @wraps(function) |
| 180 | def wrapper(*args, **kwargs): |
| 181 | name = self.get_name(function, args[0]) |
| 182 | strings = ["%s" % repr(arg) for arg in args] |
| 183 | strings += ["%s=%s" % (k, repr(v)) for k, v in kwargs.items()] |
| 184 | logger.info("[call] %s(%s)" % (name, ", ".join(strings))) |
| 185 | return function(*args, **kwargs) |
| 186 | |
| 187 | return wrapper |
| 188 | |
| 189 | def result(self, function): |
| 190 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected