<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_log(self, message):
 """ Write a line to the VM instruction log file. Args: message (str):
 string message to write to file. """

        if self._is_write_log and self.log_file and not self.log_file.closed:
            self.log_file.write(message + '\n')