提交 cc0b3d09 编写于 作者: L lindzh 提交者: von gosling

[ROCKETMQ-336] Wrong format System.out.printf used in mqadmin (#208)

上级 c7fea667
......@@ -134,8 +134,7 @@ public class BrokerStartup {
MixAll.properties2Object(ServerUtil.commandLine2Properties(commandLine), brokerConfig);
if (null == brokerConfig.getRocketmqHome()) {
System.out.printf("Please set the " + MixAll.ROCKETMQ_HOME_ENV
+ " variable in your environment to match the location of the RocketMQ installation");
System.out.printf("Please set the %s variable in your environment to match the location of the RocketMQ installation", MixAll.ROCKETMQ_HOME_ENV);
System.exit(-2);
}
......
......@@ -72,7 +72,7 @@ public class NamesrvStartup {
namesrvConfig.setConfigStorePath(file);
System.out.printf("load config properties file OK, " + file + "%n");
System.out.printf("load config properties file OK, %s%n", file);
in.close();
}
}
......@@ -123,7 +123,7 @@ public class NamesrvStartup {
String tip = "The Name Server boot success. serializeType=" + RemotingCommand.getSerializeTypeConfigInThisServer();
log.info(tip);
System.out.printf(tip + "%n");
System.out.printf("%s%n", tip);
return controller;
} catch (Throwable e) {
......
......@@ -171,7 +171,7 @@ public class CLusterSendMsgRTCommand implements SubCommand {
failCount
);
} else {
System.out.printf(String.format("%s|%s|%s|%s|%s%n", getCurTime(),
System.out.printf("%s", String.format("%s|%s|%s|%s|%s%n", getCurTime(),
machineRoom, clusterName, brokerName,
new BigDecimal(rt).setScale(0, BigDecimal.ROUND_HALF_UP)));
}
......
......@@ -126,7 +126,7 @@ public class ConsumerSubCommand implements SubCommand {
ConsumerRunningInfo consumerRunningInfo =
defaultMQAdminExt.getConsumerRunningInfo(group, clientId, jstack);
if (consumerRunningInfo != null) {
System.out.printf(consumerRunningInfo.formatString());
System.out.printf("%s", consumerRunningInfo.formatString());
}
}
} catch (Exception e) {
......
......@@ -146,11 +146,11 @@ public class PrintMessageSubCommand implements SubCommand {
printMessage(pullResult.getMsgFoundList(), charsetName, printBody);
break;
case NO_MATCHED_MSG:
System.out.printf(mq + " no matched msg. status=%s, offset=%s", pullResult.getPullStatus(), offset);
System.out.printf("%s no matched msg. status=%s, offset=%s", mq, pullResult.getPullStatus(), offset);
break;
case NO_NEW_MSG:
case OFFSET_ILLEGAL:
System.out.printf(mq + " print msg finished. status=%s, offset=%s", pullResult.getPullStatus(), offset);
System.out.printf("%s print msg finished. status=%s, offset=%s", mq, pullResult.getPullStatus(), offset);
break READQ;
}
} catch (Exception e) {
......
......@@ -138,7 +138,7 @@ public class UpdateTopicSubCommand implements SubCommand {
String brokerName = CommandUtil.fetchBrokerNameByAddr(defaultMQAdminExt, addr);
String orderConf = brokerName + ":" + topicConfig.getWriteQueueNums();
defaultMQAdminExt.createOrUpdateOrderConf(topicConfig.getTopicName(), orderConf, false);
System.out.printf(String.format("set broker orderConf. isOrder=%s, orderConf=[%s]",
System.out.printf("%s", String.format("set broker orderConf. isOrder=%s, orderConf=[%s]",
isOrder, orderConf.toString()));
}
System.out.printf("create topic to %s success.%n", addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册