MCPcopy Index your code
hub / github.com/MCSLTeam/MCSL2 / critical

Method critical

MCSL2Lib/ProgramControllers/logController.py:133–147  ·  view source on GitHub ↗
(self, exc: Optional[Exception] = None, msg: Optional[str] = "")

Source from the content-addressed store, hash-verified

131 self.logger.debug(self._template(caller_info, msg))
132
133 def critical(self, exc: Optional[Exception] = None, msg: Optional[str] = ""):
134 frame = getframeinfo(currentframe().f_back)
135 caller_info = {
136 "module": getmodulename(frame.filename),
137 "filename": frame.filename,
138 "line": frame.lineno,
139 "function": frame.function,
140 }
141 excStr = ""
142 if exc is not None:
143 if isinstance(exc, BaseException):
144 excStr = "".join(format_exception(type(exc), exc, exc.__traceback__))
145 else:
146 excStr = str(exc)
147 self.logger.critical(self._template(caller_info, f"{msg}\n{excStr}"))
148
149
150# Example usage

Callers 1

notifyMethod · 0.80

Calls 1

_templateMethod · 0.95

Tested by

no test coverage detected