<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def writeLog(self, network):
 """ Writes to the log file. """

        if self.log:
            writeArray(self._logPtr, self.activation)
            if self._namePtr:
                self._namePtr.write(network.getWord(self.activation))
                self._namePtr.write("\n")