summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/controllers/frontend_logging.py
blob: 77372c6556b2bbec09711f83dd640c472a31bea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from __future__ import absolute_import

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)