accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Coleman" <d...@etcoleman.com>
Subject RE: [GitHub] accumulo pull request: ACCUMULO-3681 modified log statements that ...
Date Sun, 22 Mar 2015 20:43:49 GMT
The basic issue was pointed out that the original - using just
e.getMessage() could cause problems because the log message is expecting a
format string, so if e.getMessage() had {} in the message it would be
interrupted for parameter replacement / expansion but there would be no
parameter.

The "{}" gets around that and leaves the message as currently emitted.  Even
better would be to use meaningful messages, but this was the most expedient
to eliminate a potential problem and allows better messages in the future as
long as we accept changing the log statements.

-----Original Message-----
From: joshelser [mailto:git@git.apache.org] 
Sent: Sunday, March 22, 2015 4:17 PM
To: dev@accumulo.apache.org
Subject: [GitHub] accumulo pull request: ACCUMULO-3681 modified log
statements that ...

Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/24#discussion_r26906707
  
    --- Diff:
core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java
---
    @@ -92,13 +92,13 @@ public void run() {
               return;
             }
           } catch (IsolationException | ScanTimedOutException |
AccumuloException | AccumuloSecurityException | TableDeletedException |
TableOfflineException e) {
    -        log.trace(e.getMessage(), e);
    +        log.trace("{}", e.getMessage(), e);
    --- End diff --
    
    General question: is it worth inserting the formatting string when there
isn't any concatenation happening?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---


Mime
View raw message