def __call__(self, *args, **kwargs):
        """Log the given message to the app.log or global log.

        Log the given message to the app.log or global log as
        appropriate.
        """
        # Do NOT use try/except here. See
        # https://github.com/cherrypy/cherrypy/issues/945
        if hasattr(request, 'app') and hasattr(request.app, 'log'):
            log = request.app.log
        else:
            log = self
        return log.error(*args, **kwargs)
Log the given message to the app.log or global log.

        Log the given message to the app.log or global log as
        appropriate.
        
cherrypy/__init__.py