mxsm commented on code in PR #5709:
URL: https://github.com/apache/rocketmq/pull/5709#discussion_r1050298787
##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java:
##########
@@ -112,25 +113,26 @@ public static void parseCommandlineAndConfigFile(String[]
args) throws Exception
}
}
+
MixAll.properties2Object(ServerUtil.commandLine2Properties(commandLine),
namesrvConfig);
if (commandLine.hasOption('p')) {
- MixAll.printObjectProperties(null, namesrvConfig);
- MixAll.printObjectProperties(null, nettyServerConfig);
- MixAll.printObjectProperties(null, nettyClientConfig);
- MixAll.printObjectProperties(null, controllerConfig);
+ MixAll.printObjectProperties(LOGGER_CONSOLE, namesrvConfig);
+ MixAll.printObjectProperties(LOGGER_CONSOLE, nettyServerConfig);
+ MixAll.printObjectProperties(LOGGER_CONSOLE, nettyClientConfig);
+ if (namesrvConfig.isEnableControllerInNamesrv()) {
+ MixAll.printObjectProperties(LOGGER_CONSOLE, controllerConfig);
+ }
System.exit(0);
}
-
MixAll.properties2Object(ServerUtil.commandLine2Properties(commandLine),
namesrvConfig);
-
if (null == namesrvConfig.getRocketmqHome()) {
System.out.printf("Please set the %s variable in your environment
to match the location of the RocketMQ installation%n",
MixAll.ROCKETMQ_HOME_ENV);
System.exit(-2);
}
- log = LoggerFactory.getLogger(LoggerName.NAMESRV_LOGGER_NAME);
+ LOGGER = LoggerFactory.getLogger(LoggerName.NAMESRV_LOGGER_NAME);
Review Comment:
@Oliverwqcwrw I think it is fine to keep it as is because LOGGER is not used
when the startup fails or when the -p command is used. Reducing unnecessary
loads helps to reduce startup time in some cases. Of course, it is also
possible to initialize it at the beginning.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]