<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rotate(self, log):
 """Move the current log to a new file with timestamp and create a new empty log file."""

        self.write(log, rotate=True)
        self.write({})