code: def patch_logging(self):
          
          if not hasattr(logging, "getLogger"):
              def getLogger(name=None):
                  other = Logger(self)
                  if name is not None:
                      other.name = name
                  return other
              logging.getLogger = getLogger
docs: Patches built-in Python logging if necessary.