docs: def do_write(self, msg):
          """Handling writing an individual record; we do a fresh open every time.
          This assumes emit() has already locked the file."""
          self.stream = self.do_open()
          stream = self.stream
          stream.write(msg)
          if self.terminator:
              stream.write(self.terminator)
          stream.flush()
          self._close()
          return