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

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

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