code: def log_inference(batch_id, batch_num, metric, step_loss, log_interval):
      
      metric_nm, metric_val = metric.get()
      if not isinstance(metric_nm, list):
          metric_nm = [metric_nm]
          metric_val = [metric_val]
  
      eval_str = '[Batch %d/%d] loss=%.4f, metrics:' + \
                 ','.join([i + ':%.4f' for i in metric_nm])
      logging.info(eval_str, batch_id + 1, batch_num, \
                   step_loss / log_interval, \
                   *metric_val)
docs: Generate and print out the log message for inference.