Repository: jena
Updated Branches:
  refs/heads/master 3b77e7bcd -> dee9df510


Fix contract for setCmdLogging

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

Branch: refs/heads/master
Commit: cd601a49d96b27175d66b0c0253f59e5e6b954e6
Parents: 3b77e7b
Author: Andy Seaborne <[email protected]>
Authored: Sat Oct 25 17:14:34 2014 +0100
Committer: Andy Seaborne <[email protected]>
Committed: Sat Oct 25 17:14:34 2014 +0100

----------------------------------------------------------------------
 .../org/apache/jena/atlas/logging/LogCtl.java   | 23 ++++++--------------
 1 file changed, 7 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/cd601a49/jena-arq/src/main/java/org/apache/jena/atlas/logging/LogCtl.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/logging/LogCtl.java 
b/jena-arq/src/main/java/org/apache/jena/atlas/logging/LogCtl.java
index 4572a37..fba332b 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/logging/LogCtl.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/logging/LogCtl.java
@@ -212,15 +212,13 @@ public class LogCtl {
      * Return true if we think Log4J is not initialized.
      */
     
-    public static boolean setLog4j() {
+    public static void setLog4j() {
         if ( System.getProperty("log4j.configuration") == null ) {
             String fn = "log4j.properties" ;
             File f = new File(fn) ;
             if ( f.exists() )
                 System.setProperty("log4j.configuration", "file:" + fn) ;
         }
-    
-        return (System.getProperty("log4j.configuration") != null) ;
     }
 
     /** Set log4j properties (XML or properties file) */
@@ -233,11 +231,8 @@ public class LogCtl {
 
     /**
      * Set logging, suitable for a command line application.
-     * <ol>
-     * <li>Check for -Dlog4j.configuration.</li>
-     * <li>Looks for log4j.properties file in current directory.</li>
-     * <li>Sets log4j using an internal configuration.</li>
-     * </ol>
+     * If "log4j.configuration" not set, then use the built-in default, 
+     * else just leave to log4j startup.
      */
     public static void setCmdLogging() {
         setCmdLogging(log4Jsetup) ;
@@ -245,16 +240,12 @@ public class LogCtl {
 
     /**
      * Set logging, suitable for a command line application.
-     * <ol>
-     * <li>Check for -Dlog4j.configuration.</li>
-     * <li>Looks for log4j.properties file in current directory.</li>
-     * <li>Sets log4j using the provided default configuration.</li>
-     * </ol>
-     * T
+     * If "log4j.configuration" not set, then use the provided default 
+     * (log4j properties syntax) else just leave to log4j startup.
      */
     public static void setCmdLogging(String defaultConfig) {
-        if ( !setLog4j() )
-            resetLogging(log4Jsetup) ;
+        if (System.getProperty("log4j.configuration") == null )
+            resetLogging(defaultConfig) ;
     }
 
     public static void resetLogging(String config) {

Reply via email to