-
Notifications
You must be signed in to change notification settings - Fork 11.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #5708]Fix NamesrvStartup can't print config when use -p command #5709
Conversation
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can LOGGER be initialized directly when variables are defined? Is it better to keep it the same as LOGGER_CONSOLE? WDYT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will
Codecov Report
@@ Coverage Diff @@
## develop #5709 +/- ##
=============================================
+ Coverage 42.38% 42.41% +0.02%
- Complexity 8218 8227 +9
=============================================
Files 1060 1060
Lines 73354 73356 +2
Branches 9598 9599 +1
=============================================
+ Hits 31093 31112 +19
+ Misses 38346 38333 -13
+ Partials 3915 3911 -4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -42,7 +42,8 @@ | |||
|
|||
public class NamesrvStartup { | |||
|
|||
private static Logger log; | |||
private final static Logger LOGGER = LoggerFactory.getLogger(LoggerName.NAMESRV_LOGGER_NAME); | |||
private final static Logger LOGGER_CONSOLE = LoggerFactory.getLogger(LoggerName.NAMESRV_CONSOLE_LOGGER_NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use LOGGER ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fuyou001 LOGGER print log in file, LOGGER_CONSOLE print on console, -p command should be printed on console
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fuyou001 LOGGER print log in file, LOGGER_CONSOLE print on console, -p command should be printed on console
I got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep log format may better
https://docs.oracle.com/javase/specs/jls/se17/html/jls-4.html
@lizhimins thanks for you suggestion. I hava read docuemnts and I will modify it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -42,7 +42,8 @@ | |||
|
|||
public class NamesrvStartup { | |||
|
|||
private static Logger log; | |||
private final static Logger LOGGER = LoggerFactory.getLogger(LoggerName.NAMESRV_LOGGER_NAME); | |||
private final static Logger LOGGER_CONSOLE = LoggerFactory.getLogger(LoggerName.NAMESRV_CONSOLE_LOGGER_NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ddaa833
c9c170d
to
ca3d9b1
Compare
Make sure set the target branch to
develop
What is the purpose of the change
close #5708
Brief changelog
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.