You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by swallez <gi...@git.apache.org> on 2016/12/23 17:21:27 UTC

[GitHub] curator pull request #179: [CURATOR-369] Improve log for new configuration e...

GitHub user swallez opened a pull request:

    https://github.com/apache/curator/pull/179

    [CURATOR-369] Improve log for new configuration events

    Logging the configuration data only after it has been parsed into a `Properties` object. This allows logging readable text instead of an array of bytes.
    
    Also guarded the log statement with a test on the log level, as `Properties.toString()` is a costly operation.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/swallez/curator CURATOR-369

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/179.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #179
    
----
commit 69454859bb8ef1f0d683f9bc79af019d7a527f1e
Author: Sylvain Wallez <sy...@bluxte.net>
Date:   2016-12-23T17:17:45Z

    [CURATOR-369] Improve log for new configuration events

----


---
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.
---

[GitHub] curator issue #179: [CURATOR-369] Improve log for new configuration events

Posted by swallez <gi...@git.apache.org>.
Github user swallez commented on the issue:

    https://github.com/apache/curator/pull/179
  
    Doh. Thanks @Randgalt! I've been using ifXxxxEnabled for so many years that it's still engraved in my fingers. Fixed!


---
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.
---

[GitHub] curator pull request #179: [CURATOR-369] Improve log for new configuration e...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/curator/pull/179


---
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.
---

[GitHub] curator pull request #179: [CURATOR-369] Improve log for new configuration e...

Posted by Randgalt <gi...@git.apache.org>.
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/curator/pull/179#discussion_r93817403
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java ---
    @@ -179,13 +179,16 @@ public static String configToConnectionString(QuorumVerifier data) throws Except
     
         private void processConfigData(byte[] data) throws Exception
         {
    -        log.info("New config event received: " + Arrays.toString(data));
    -
             Properties properties = new Properties();
             properties.load(new ByteArrayInputStream(data));
             QuorumMaj newConfig = new QuorumMaj(properties);
             currentConfig.set(newConfig);
     
    +        if ( log.isInfoEnabled() )
    --- End diff --
    
    Instead of this check you can do:
    
    ```java
    log.info("New config event received: {}", properties.toString());
    ```
    
    or
    
    ```java
    log.info(String.format("New config event received: %s", properties.toString()));
    ```



---
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.
---