<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def error(self, msg, repeat_at_end=True):
 """Log a non-fatal error message to stderr, which is repeated at program termination. :param msg: Message to be printed. :param repeat_at_end: Set to false if the message should be printed, but not repeated at program termination."""

        print(msg, file=sys.stderr)
        if repeat_at_end:
            self.error_log.append(msg)