<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log(self, metric):
 """Format and output metric. Args: metric (dict):
 Complete metric. """

        message = self.LOGFMT.format(**metric)
        if metric['context']:
            message += ' context: {context}'.format(context=metric['context'])
        self._logger.log(self.level, message)