summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/controllers/frontend_logging.py
blob: df9ca19ccfe0826ac5a780b203451b25f2147ee6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import logging

from . import BaseController, Endpoint, UIRouter

logger = logging.getLogger('frontend.error')


@UIRouter('/logging', secure=False)
class FrontendLogging(BaseController):

    @Endpoint('POST', path='js-error')
    def jsError(self, url, message, stack=None):  # noqa: N802
        logger.error('(%s): %s\n %s\n', url, message, stack)