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

Class FileHandler

src/pybind/mgr/mgr_module.py:733–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731
732
733class FileHandler(logging.FileHandler):
734 def __init__(self, module_inst: Any):
735 path = module_inst.get_ceph_option("log_file")
736 idx = path.rfind(".log")
737 if idx != -1:
738 self.path = "{}.{}.log".format(path[:idx], module_inst.module_name)
739 else:
740 self.path = "{}.{}".format(path, module_inst.module_name)
741 super(FileHandler, self).__init__(self.path, delay=True)
742 self.setFormatter(logging.Formatter("%(asctime)s [%(threadName)s] [%(levelname)-4s] [%(name)s] %(message)s"))
743
744
745class MgrModuleLoggingMixin(object):

Callers 1

_configure_loggingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected