docs: def log(self, logfile=None):
          """Log the ASCII traceback into a file object."""
          if logfile is None:
              logfile = sys.stderr
          tb = self.plaintext.encode('utf-8', 'replace').rstrip() + '\n'
          logfile.write(tb)