Make log.firewall display the callback name in any case.

This commit is contained in:
Valentin Lorentz 2013-07-11 10:07:11 +02:00
parent 4647ed81fd
commit f22f0bb4b6

View File

@ -346,9 +346,10 @@ def firewall(f, errorHandler=None):
if s is None: if s is None:
s = 'Uncaught exception' s = 'Uncaught exception'
if hasattr(self, 'log'): if hasattr(self, 'log'):
self.log.exception('%s:', s) logging_function = self.log.exception
else: else:
exception('%s in %s.%s:', s, self.__class__.__name__, f.func_name) logging_function = exception
logging_function('%s in %s.%s:', s, self.__class__.__name__, f.func_name)
def m(self, *args, **kwargs): def m(self, *args, **kwargs):
try: try:
return f(self, *args, **kwargs) return f(self, *args, **kwargs)