+@fetchkeys
+def log(self, level, msg, *args, **kwargs):
+ # type: (int, str) -> None
+ """
+ If a specific logging level enabled and the code is represented
+ as an integer value, delegate the call to the underlying logger.
+
+ Raises:
+ TypeError: if the logging level code is not an integer.
+ """
+
+ if not isinstance(level, int):
+ if logging.raiseExceptions:
+ raise TypeError("Logging level code must be an integer."
+ "Got %s instead." % type(level))
+ else:
+ return
+
+ if self.isEnabledFor(level):
+ self._log(level, msg, args, **kwargs)
+
+
+def handle(self, record):
+ # type: (LogRecord) -> None
+ cmarker = getattr(self, MARKER_TAG, None)
+
+ if isinstance(cmarker, Marker):
+ setattr(record, MARKER_TAG, cmarker)
+
+ if not self.disabled and \
+ self.filter(record):
+ self.callHandlers(record)
+
+
+def findCaller(self, stack_info=False):
+ # type: (bool) -> Tuple
+ """
+ Find the stack frame of the caller so that we can note the source file
+ name, line number and function name. Enhances the logging.findCaller().
+ """