code: def write(self, path):
          
          with io.open(path, "w", encoding="utf-8") as log_file:
              log_file.write(self.pretty_print())
docs: Output the log to file.
  
          :param string path: the path of the log file to be written