You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "liyuheng55555 (via GitHub)" <gi...@apache.org> on 2024/11/19 10:35:41 UTC
[PR] LOGGER.error(e.getMessage()) IS REALLY A BAD IDEA [iotdb]
liyuheng55555 opened a new pull request, #14137:
URL: https://github.com/apache/iotdb/pull/14137
(no comment)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] LOGGER.error(e.getMessage()) IS REALLY A BAD IDEA [iotdb]
Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #14137:
URL: https://github.com/apache/iotdb/pull/14137#discussion_r1851275011
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/dataregion/DataRegionStateMachine.java:
##########
@@ -349,7 +349,7 @@ public DataSet read(IConsensusRequest request) {
try {
fragmentInstance = getFragmentInstance(request);
} catch (IllegalArgumentException e) {
- logger.error(e.getMessage());
+ logger.error(e.getMessage(), e);
Review Comment:
Add some context for string?
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] LOGGER.error(e.getMessage()) IS REALLY A BAD IDEA [iotdb]
Posted by "liyuheng55555 (via GitHub)" <gi...@apache.org>.
liyuheng55555 commented on code in PR #14137:
URL: https://github.com/apache/iotdb/pull/14137#discussion_r1851221325
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/dataregion/DataRegionStateMachine.java:
##########
@@ -349,7 +349,7 @@ public DataSet read(IConsensusRequest request) {
try {
fragmentInstance = getFragmentInstance(request);
} catch (IllegalArgumentException e) {
- logger.error(e.getMessage());
+ logger.error(e.getMessage(), e);
Review Comment:
Indeed, but log4j interface always asks for a String parameter. There are some cases where I can only provide the exception stack and no additional information. In such cases, how should the string be written? Maybe just an empty string?
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] LOGGER.error(e.getMessage()) IS REALLY A BAD IDEA [iotdb]
Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum commented on code in PR #14137:
URL: https://github.com/apache/iotdb/pull/14137#discussion_r1848372576
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/dataregion/DataRegionStateMachine.java:
##########
@@ -349,7 +349,7 @@ public DataSet read(IConsensusRequest request) {
try {
fragmentInstance = getFragmentInstance(request);
} catch (IllegalArgumentException e) {
- logger.error(e.getMessage());
+ logger.error(e.getMessage(), e);
Review Comment:
If use log.error("xxxx", e) will contains e.message, maybe we do not need to use `logger.error(e.getMessage(), e);`?
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] LOGGER.error(e.getMessage()) IS REALLY A BAD IDEA [iotdb]
Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum merged PR #14137:
URL: https://github.com/apache/iotdb/pull/14137
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org