ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [02/40] ignite git commit: IGNITE-4248: Fixed: Some loggers ignore IGNITE_QUIET system property. This closes #1367.
Date Mon, 09 Jan 2017 17:02:34 GMT
IGNITE-4248: Fixed: Some loggers ignore IGNITE_QUIET system property. This closes #1367.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c103ac33
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c103ac33
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c103ac33

Branch: refs/heads/ignite-comm-balance-master
Commit: c103ac33d590492577bb687b29969550cdb532cf
Parents: 83d961c
Author: Andrey V. Mashenkov <andrey.mashenkov@gmail.com>
Authored: Wed Dec 21 16:53:18 2016 +0300
Committer: Andrey V. Mashenkov <andrey.mashenkov@gmail.com>
Committed: Wed Dec 21 16:53:18 2016 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/IgniteLogger.java    |  4 ++--
 .../processors/hadoop/impl/igfs/HadoopIgfsJclLogger.java |  9 ++++++++-
 .../java/org/apache/ignite/logger/jcl/JclLogger.java     |  9 ++++++++-
 .../java/org/apache/ignite/logger/slf4j/Slf4jLogger.java | 11 +++++++++--
 4 files changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c103ac33/modules/core/src/main/java/org/apache/ignite/IgniteLogger.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteLogger.java b/modules/core/src/main/java/org/apache/ignite/IgniteLogger.java
index f3afa99..8d814fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteLogger.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteLogger.java
@@ -146,9 +146,9 @@ public interface IgniteLogger {
     public boolean isInfoEnabled();
 
     /**
-     * Tests whether {@code info} and {@code debug} levels are turned off.
+     * Tests whether Logger is in "Quiet mode".
      *
-     * @return Whether {@code info} and {@code debug} levels are turned off.
+     * @return {@code true} "Quiet mode" is enabled, {@code false} otherwise
      */
     public boolean isQuiet();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c103ac33/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsJclLogger.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsJclLogger.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsJclLogger.java
index 0ae8a9f..6475204 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsJclLogger.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopIgfsJclLogger.java
@@ -24,6 +24,8 @@ import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.jetbrains.annotations.Nullable;
 
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_QUIET;
+
 /**
  * JCL logger wrapper for Hadoop.
  */
@@ -32,6 +34,9 @@ public class HadoopIgfsJclLogger implements IgniteLogger {
     @GridToStringInclude
     private Log impl;
 
+    /** Quiet flag. */
+    private final boolean quiet;
+
     /**
      * Constructor.
      *
@@ -41,6 +46,8 @@ public class HadoopIgfsJclLogger implements IgniteLogger {
         assert impl != null;
 
         this.impl = impl;
+
+        quiet = Boolean.valueOf(System.getProperty(IGNITE_QUIET, "true"));
     }
 
     /** {@inheritDoc} */
@@ -81,7 +88,7 @@ public class HadoopIgfsJclLogger implements IgniteLogger {
 
     /** {@inheritDoc} */
     @Override public boolean isQuiet() {
-        return !isInfoEnabled() && !isDebugEnabled();
+        return quiet;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/c103ac33/modules/jcl/src/main/java/org/apache/ignite/logger/jcl/JclLogger.java
----------------------------------------------------------------------
diff --git a/modules/jcl/src/main/java/org/apache/ignite/logger/jcl/JclLogger.java b/modules/jcl/src/main/java/org/apache/ignite/logger/jcl/JclLogger.java
index a13caa1..c75197a 100644
--- a/modules/jcl/src/main/java/org/apache/ignite/logger/jcl/JclLogger.java
+++ b/modules/jcl/src/main/java/org/apache/ignite/logger/jcl/JclLogger.java
@@ -22,6 +22,8 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.ignite.IgniteLogger;
 import org.jetbrains.annotations.Nullable;
 
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_QUIET;
+
 /**
  * This logger wraps any JCL (<a target=_blank href="http://jakarta.apache.org/commons/logging/">Jakarta
Commons Logging</a>)
  * loggers. Implementation simply delegates to underlying JCL logger. This logger
@@ -77,6 +79,9 @@ public class JclLogger implements IgniteLogger {
     /** JCL implementation proxy. */
     private Log impl;
 
+    /** Quiet flag. */
+    private final boolean quiet;
+
     /**
      * Creates new logger.
      */
@@ -93,6 +98,8 @@ public class JclLogger implements IgniteLogger {
         assert impl != null;
 
         this.impl = impl;
+
+        quiet = Boolean.valueOf(System.getProperty(IGNITE_QUIET, "true"));
     }
 
     /** {@inheritDoc} */
@@ -133,7 +140,7 @@ public class JclLogger implements IgniteLogger {
 
     /** {@inheritDoc} */
     @Override public boolean isQuiet() {
-        return !isInfoEnabled() && !isDebugEnabled();
+        return quiet;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/c103ac33/modules/slf4j/src/main/java/org/apache/ignite/logger/slf4j/Slf4jLogger.java
----------------------------------------------------------------------
diff --git a/modules/slf4j/src/main/java/org/apache/ignite/logger/slf4j/Slf4jLogger.java b/modules/slf4j/src/main/java/org/apache/ignite/logger/slf4j/Slf4jLogger.java
index 51e5669..2b0e980 100644
--- a/modules/slf4j/src/main/java/org/apache/ignite/logger/slf4j/Slf4jLogger.java
+++ b/modules/slf4j/src/main/java/org/apache/ignite/logger/slf4j/Slf4jLogger.java
@@ -22,6 +22,8 @@ import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_QUIET;
+
 /**
  * SLF4J-based implementation for logging. This logger should be used
  * by loaders that have prefer slf4j-based logging.
@@ -41,11 +43,14 @@ public class Slf4jLogger implements IgniteLogger {
     /** SLF4J implementation proxy. */
     private final Logger impl;
 
+    /** Quiet flag. */
+    private final boolean quiet;
+
     /**
      * Creates new logger.
      */
     public Slf4jLogger() {
-        impl = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        this(LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME));
     }
 
     /**
@@ -57,6 +62,8 @@ public class Slf4jLogger implements IgniteLogger {
         assert impl != null;
 
         this.impl = impl;
+
+        quiet = Boolean.valueOf(System.getProperty(IGNITE_QUIET, "true"));
     }
 
     /** {@inheritDoc} */
@@ -129,7 +136,7 @@ public class Slf4jLogger implements IgniteLogger {
 
     /** {@inheritDoc} */
     @Override public boolean isQuiet() {
-        return !isInfoEnabled() && !isDebugEnabled();
+        return quiet;
     }
 
     /** {@inheritDoc} */


Mime
View raw message