MCPcopy Create free account
hub / github.com/ceph/ceph / ClusterLogHandler

Class ClusterLogHandler

src/pybind/mgr/mgr_module.py:712–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710
711
712class ClusterLogHandler(logging.Handler):
713 def __init__(self, module_inst: Any):
714 super().__init__()
715 self._module = module_inst
716 self.setFormatter(logging.Formatter("%(message)s"))
717
718 def emit(self, record: logging.LogRecord) -> None:
719 levelmap = {
720 logging.DEBUG: MgrModule.ClusterLogPrio.DEBUG,
721 logging.INFO: MgrModule.ClusterLogPrio.INFO,
722 logging.WARNING: MgrModule.ClusterLogPrio.WARN,
723 logging.ERROR: MgrModule.ClusterLogPrio.ERROR,
724 logging.CRITICAL: MgrModule.ClusterLogPrio.ERROR,
725 }
726 level = levelmap[record.levelno]
727 if record.levelno >= self.level:
728 self._module.cluster_log(self._module.module_name,
729 level,
730 self.format(record))
731
732
733class FileHandler(logging.FileHandler):

Callers 1

_configure_loggingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected