code: def log(self, metric):
          
          message = self.LOGFMT.format(**metric)
          if metric['context']:
              message += ' context: {context}'.format(context=metric['context'])
          self._logger.log(self.level, message)
docs: Format and output metric.
  
          Args:
              metric (dict): Complete metric.