<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, pos=None):
 """Logs an error message pertaining to the given SeqPos."""

    self.log(msg, 'error: ' + self.location(pos))