geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r505902 - /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/LogSupport.groovy
Date Sun, 11 Feb 2007 11:53:21 GMT
Author: jdillon
Date: Sun Feb 11 03:53:20 2007
New Revision: 505902

URL: http://svn.apache.org/viewvc?view=rev&rev=505902
Log:
Add getLog() helper to hide JCL details

Modified:
    geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/LogSupport.groovy

Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/LogSupport.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/LogSupport.groovy?view=diff&rev=505902&r1=505901&r2=505902
==============================================================================
--- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/LogSupport.groovy
(original)
+++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/LogSupport.groovy
Sun Feb 11 03:53:20 2007
@@ -35,5 +35,17 @@
         LogFactory.getFactory().setAttribute('org.apache.commons.logging.Log', 'org.apache.commons.logging.impl.SimpleLog')
     }
     
-    protected Log log = LogFactory.getLog(this.class)
+    public static Log getLog(obj) {
+        if (obj instanceof Class) {
+            return LogFactory.getLog(obj)
+        }
+        else if (obj instanceof String) {
+            return LogFactory.getLog(obj)
+        }
+        else {
+            return LogFactory.getLog(obj.class)
+        }
+    }
+    
+    protected Log log = getLog(this)
 }



Mime
View raw message