def log(self, metric):
message = self.LOGFMT.format(**metric)<EOL>if metric['<STR_LIT>']:<EOL><INDENT>message += '<STR_LIT>'.format(context=metric['<STR_LIT>'])<EOL><DEDENT>self._logger.log(self.level, message)<EOL>
Format and output metric.

        Args:
            metric (dict): Complete metric.