def log_train(batch_id, batch_num, metric, step_loss, log_interval, epoch_id, learning_rate):
metric_nm, metric_val = metric.get()<EOL>if not isinstance(metric_nm, list):<EOL><INDENT>metric_nm = [metric_nm]<EOL>metric_val = [metric_val]<EOL><DEDENT>train_str = '<STR_LIT>' +'<STR_LIT:U+002C>'.join([i + '<STR_LIT>' for i in metric_nm])<EOL>logging.info(train_str, epoch_id + <NUM_LIT:1>, batch_id + <NUM_LIT:1>, batch_num,step_loss / log_interval,learning_rate,*metric_val)<EOL>
Generate and print out the log message for training.