code: def _log_to_stderr(self, record):
      
      # emit() is protected by a lock in logging.Handler, so we don't need to
      # protect here again.
      old_stream = self.stream
      self.stream = sys.stderr
      try:
        super(PythonHandler, self).emit(record)
      finally:
        self.stream = old_stream
docs: Emits the record to stderr.
  
      This temporarily sets the handler stream to stderr, calls
      StreamHandler.emit, then reverts the stream back.
  
      Args:
        record: logging.LogRecord, the record to log.