code: def flush(self):
          
          # See /usr/lib64/python2.7/logging/__init__.py, StreamHander.flush()
          self.acquire()
          try:
              if self.stream and hasattr(self.stream, "flush"):
                  self.stream.flush()
          except IOError as e:
              if self.abortOnIOError:
                  sys.exit('IOError: %s' % e)
              else:
                  raise e
          finally:
              self.release()
docs: Flush the stream.
  
          In contrast to StreamHandler, errors are not caught so the program doesn't iterate
          through tons of logging errors e.g. in case of a broken pipe.