<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(self, path):
 """ Output the log to file. :param string path: the path of the log file to be written """

        with io.open(path, "w", encoding="utf-8") as log_file:
            log_file.write(self.pretty_print())