Permalink
Browse files

split out logging transformer from logging plugin to make it easier t…

…o exclude logging plugin (relates to GRAILS-7588)
  • Loading branch information...
1 parent b96c878 commit bf0c89fbd7a55e70180feef23d7d81a71ed9bec8 Graeme Rocher committed Sep 20, 2011
Showing with 229 additions and 225 deletions.
  1. +1 −1 build.gradle
  2. +2 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsCoreDependencies.java
  3. +192 −192 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/CorePluginFinder.java
  4. +5 −0 grails-logging/build.gradle
  5. 0 ...ails-logging}/src/main/groovy/org/codehaus/groovy/grails/compiler/logging/LoggingTransformer.java
  6. 0 ...ogging}/src/test/groovy/org/codehaus/groovy/grails/compiler/logging/LoggingTransformerSpec.groovy
  7. +1 −1 grails-plugin-gsp/build.gradle
  8. +2 −5 {grails-plugin-logging → grails-plugin-log4j}/build.gradle
  9. +2 −2 ... grails-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j}/Log4jConfig.groovy
  10. +4 −5 ...plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j}/LoggingGrailsPlugin.groovy
  11. +1 −1 ...ls-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j}/LoggingInitializer.java
  12. +1 −1 ...4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j}/appenders/GrailsConsoleAppender.java
  13. +2 −2 ...log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j}/web/util/Log4jConfigListener.java
  14. 0 ...lugin-logging → grails-plugin-log4j}/src/main/groovy/org/slf4j/impl/GrailsLog4jLoggerAdapter.java
  15. 0 ...s-plugin-logging → grails-plugin-log4j}/src/main/groovy/org/slf4j/impl/GrailsLog4jMDCAdapter.java
  16. 0 ...lugin-logging → grails-plugin-log4j}/src/main/groovy/org/slf4j/impl/GrailsSlf4jLoggerFactory.java
  17. 0 {grails-plugin-logging → grails-plugin-log4j}/src/main/groovy/org/slf4j/impl/StaticLoggerBinder.java
  18. 0 {grails-plugin-logging → grails-plugin-log4j}/src/main/groovy/org/slf4j/impl/StaticMDCBinder.java
  19. 0 {grails-plugin-logging → grails-plugin-log4j}/src/main/groovy/org/slf4j/impl/StaticMarkerBinder.java
  20. +3 −0 grails-plugin-log4j/src/main/resources/META-INF/grails-plugin.xml
  21. +0 −3 grails-plugin-logging/src/main/resources/META-INF/grails-plugin.xml
  22. +1 −1 grails-plugin-testing/build.gradle
  23. +1 −1 grails-scripts/build.gradle
  24. +1 −1 ...st-suite-base/src/main/groovy/org/codehaus/groovy/grails/web/taglib/AbstractGrailsTagTests.groovy
  25. +1 −1 grails-test-suite-uber/build.gradle
  26. +1 −1 ...est-suite-uber/src/test/groovy/org/codehaus/groovy/grails/commons/GrailsPluginManagerTests.groovy
  27. +1 −0 ...s-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/plugins/logging/Log4jDslTests.groovy
  28. +1 −1 ...suite-uber/src/test/groovy/org/codehaus/groovy/grails/plugins/web/LoggingGrailsPluginTests.groovy
  29. +3 −3 ...st-suite-uber/src/test/groovy/org/codehaus/groovy/grails/resolve/IvyDependencyManagerTests.groovy
  30. +1 −1 grails-test-suite-web/build.gradle
  31. +2 −1 settings.gradle
View
@@ -133,7 +133,7 @@ subprojects { project ->
// Testing
testCompile 'junit:junit:4.8.1'
- testCompile('org.spockframework:spock-core:0.5-groovy-1.8') {
+ testCompile('org.spockframework:spock-core:0.6-groovy-1.8-SNAPSHOT') {
transitive = false
}
}
@@ -173,6 +173,7 @@ public Object doCall() {
ModuleRevisionId.newInstance("org.grails", "grails-resources", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-spring", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-web", grailsVersion),
+ ModuleRevisionId.newInstance("org.grails", "grails-logging", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-datastore-core", datastoreMappingVersion),
ModuleRevisionId.newInstance("org.grails", "grails-datastore-gorm", datastoreMappingVersion),
ModuleRevisionId.newInstance("org.grails", "grails-datastore-simple", datastoreMappingVersion),
@@ -186,7 +187,7 @@ public Object doCall() {
ModuleRevisionId.newInstance("org.grails", "grails-plugin-filters", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-plugin-gsp", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-plugin-i18n", grailsVersion),
- ModuleRevisionId.newInstance("org.grails", "grails-plugin-logging", grailsVersion),
+ ModuleRevisionId.newInstance("org.grails", "grails-plugin-log4j", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-plugin-scaffolding", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-plugin-services", grailsVersion),
ModuleRevisionId.newInstance("org.grails", "grails-plugin-servlets", grailsVersion),

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,5 @@
+dependencies {
+ compile project(":grails-core"),
+ project(':grails-web')
+}
+jar.appendix = 'logging'
@@ -3,7 +3,7 @@ dependencies {
compile "commons-lang:commons-lang:$commonsLangVersion"
compile project(":grails-web"),
project(":grails-plugin-codecs"),
- project(":grails-plugin-logging"),
+ project(":grails-logging"),
project(":grails-plugin-controllers")
}
sourceSets {
@@ -1,11 +1,8 @@
dependencies {
compile "commons-beanutils:commons-beanutils:${commonsBeanUtilsVersion}"
compile 'log4j:log4j:1.2.16'
-
compile "org.slf4j:jul-to-slf4j:$slf4jVersion"
- compile project(":grails-core"),
- project(':grails-bootstrap'),
- project(':grails-web')
+ compile project(':grails-logging')
}
-jar.appendix = 'plugin-logging'
+jar.appendix = 'plugin-log4j'
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.codehaus.groovy.grails.plugins.logging
+package org.codehaus.groovy.grails.plugins.log4j
import grails.util.BuildSettings
import grails.util.BuildSettingsHolder
@@ -33,7 +33,7 @@ import org.apache.log4j.helpers.LogLog
import org.apache.log4j.jdbc.JDBCAppender
import org.apache.log4j.varia.NullAppender
import org.apache.log4j.xml.XMLLayout
-import org.codehaus.groovy.grails.plugins.logging.appenders.GrailsConsoleAppender
+import org.codehaus.groovy.grails.plugins.log4j.appenders.GrailsConsoleAppender
/**
* Encapsulates the configuration of Log4j.
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.codehaus.groovy.grails.plugins
+package org.codehaus.groovy.grails.plugins.log4j
-import grails.util.GrailsNameUtils
import grails.util.GrailsUtil
-import org.apache.commons.logging.LogFactory
import org.apache.log4j.LogManager
-import org.codehaus.groovy.grails.plugins.logging.Log4jConfig
+
import org.slf4j.bridge.SLF4JBridgeHandler
+import org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener
/**
* Provides a lazy initialized commons logging log property for all classes.
@@ -61,7 +60,7 @@ class LoggingGrailsPlugin {
mappingElement + {
'listener' {
- 'listener-class'(org.codehaus.groovy.grails.web.util.Log4jConfigListener.name)
+ 'listener-class'(Log4jConfigListener.name)
}
}
}
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.codehaus.groovy.grails.plugins.logging;
+package org.codehaus.groovy.grails.plugins.log4j;
import groovy.lang.Closure;
import groovy.util.ConfigObject;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.codehaus.groovy.grails.plugins.logging.appenders;
+package org.codehaus.groovy.grails.plugins.log4j.appenders;
import grails.build.logging.GrailsConsole;
import groovy.util.ConfigObject;
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.codehaus.groovy.grails.web.util;
+package org.codehaus.groovy.grails.plugins.log4j.web.util;
import grails.util.Environment;
import grails.util.GrailsWebUtil;
@@ -29,7 +29,7 @@
import org.apache.log4j.helpers.LogLog;
import org.codehaus.groovy.grails.commons.DefaultGrailsApplication;
import org.codehaus.groovy.grails.commons.GrailsApplication;
-import org.codehaus.groovy.grails.plugins.logging.Log4jConfig;
+import org.codehaus.groovy.grails.plugins.log4j.Log4jConfig;
/**
* Configures Log4j in WAR deployment using Grails Log4j DSL.
@@ -0,0 +1,3 @@
+<plugin name='logging'>
+ <type>org.codehaus.groovy.grails.plugins.log4j.LoggingGrailsPlugin</type>
+</plugin>
@@ -1,3 +0,0 @@
-<plugin name='logging'>
- <type>org.codehaus.groovy.grails.plugins.LoggingGrailsPlugin</type>
-</plugin>
@@ -8,7 +8,7 @@ dependencies {
project(':grails-plugin-filters'),
project(':grails-plugin-mimetypes'),
project(':grails-plugin-converters'),
- project(':grails-plugin-logging'),
+ project(':grails-logging'),
project(':grails-test'),
project(':grails-hibernate')
@@ -15,7 +15,7 @@ dependencies {
project(':grails-docs'),
project(':grails-crud'),
project(':grails-plugin-controllers'),
- project(':grails-plugin-logging'),
+ project(':grails-plugin-log4j'),
project(":grails-test"),
project(":grails-plugin-testing")
}
@@ -189,7 +189,7 @@ abstract class AbstractGrailsTagTests extends GroovyTestCase {
dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.web.mapping.UrlMappingsGrailsPlugin")
dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.web.ControllersGrailsPlugin")
dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.web.GroovyPagesGrailsPlugin")
- dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.LoggingGrailsPlugin")
+ dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.log4j.Log4jGrailsPlugin")
def dependentPlugins = dependantPluginClasses.collect { new DefaultGrailsPlugin(it, grailsApplication)}
@@ -18,7 +18,7 @@ dependencies {
project(":grails-plugin-servlets"),
project(":grails-plugin-services"),
project(":grails-plugin-i18n"),
- project(":grails-plugin-logging")
+ project(":grails-plugin-log4j")
}
test {
@@ -47,7 +47,7 @@ hibernate {
// Check that the observers are what we expect (note that the
// core plugin "logging" should be one of them).
def expectedObservers = ["logging", "observing"]
- assertTrue observers*.name.containsAll(expectedObservers)
+ assert observers*.name.containsAll(expectedObservers)
assertEquals expectedObservers.size(), observers.size()
// Also check that the "logging" plugin is observing the "my"
@@ -23,6 +23,7 @@ import org.apache.log4j.Level
import org.apache.log4j.LogManager
import org.apache.log4j.Logger
import org.apache.log4j.WriterAppender
+import org.codehaus.groovy.grails.plugins.log4j.Log4jConfig
class Log4jDslTests extends GroovyTestCase {
@@ -22,7 +22,7 @@ class LoggingGrailsPluginTests extends AbstractGrailsPluginTests {
class TestTagLib {}""")
pluginsToLoad << gcl.loadClass("org.codehaus.groovy.grails.plugins.CoreGrailsPlugin")
- pluginsToLoad << gcl.loadClass("org.codehaus.groovy.grails.plugins.LoggingGrailsPlugin")
+ pluginsToLoad << gcl.loadClass("org.codehaus.groovy.grails.plugins.log4j.LoggingGrailsPlugin")
}
void testLoggingPluginBeforeCore() {
@@ -622,7 +622,7 @@ class IvyDependencyManagerTests extends GroovyTestCase {
}
assertTrue("all default dependencies should be inherited", manager.dependencyDescriptors.every { it.inherited == true })
- assertEquals 53, manager.dependencyDescriptors.findAll { it.scope == 'compile'}.size()
+ assertEquals 54, manager.dependencyDescriptors.findAll { it.scope == 'compile'}.size()
assertEquals 14, manager.dependencyDescriptors.findAll { it.scope == 'runtime'}.size()
assertEquals 4, manager.dependencyDescriptors.findAll { it.scope == 'test'}.size()
assertEquals 23, manager.dependencyDescriptors.findAll { it.scope == 'build'}.size()
@@ -649,7 +649,7 @@ class IvyDependencyManagerTests extends GroovyTestCase {
assertEquals 0, manager.dependencyDescriptors.findAll { it.scope == 'runtime'}.size()
assertEquals 4, manager.dependencyDescriptors.findAll { it.scope == 'test'}.size()
assertEquals 23, manager.dependencyDescriptors.findAll { it.scope == 'build'}.size()
- assertEquals 70, manager.dependencyDescriptors.findAll { it.scope == 'provided'}.size()
+ assertEquals 71, manager.dependencyDescriptors.findAll { it.scope == 'provided'}.size()
assertEquals 4, manager.dependencyDescriptors.findAll { it.scope == 'docs'}.size()
manager = new IvyDependencyManager("project", "0.1",settings)
@@ -660,7 +660,7 @@ class IvyDependencyManagerTests extends GroovyTestCase {
defaultDependencyClosure()
}
- assertEquals 53, manager.dependencyDescriptors.findAll { it.scope == 'compile'}.size()
+ assertEquals 54, manager.dependencyDescriptors.findAll { it.scope == 'compile'}.size()
assertEquals 14, manager.dependencyDescriptors.findAll { it.scope == 'runtime'}.size()
assertEquals 4, manager.dependencyDescriptors.findAll { it.scope == 'test'}.size()
assertEquals 23, manager.dependencyDescriptors.findAll { it.scope == 'build'}.size()
@@ -12,7 +12,7 @@ dependencies {
project(':grails-plugin-datasource'),
project(':grails-plugin-i18n'),
project(':grails-plugin-servlets'),
- project(':grails-plugin-logging'),
+ project(':grails-plugin-log4j'),
project(':grails-plugin-url-mappings'),
project(':grails-plugin-services'),
project(':grails-hibernate'),
View
@@ -9,12 +9,13 @@ include 'grails-bootstrap',
'grails-crud',
'grails-resources',
'grails-scripts',
+ 'grails-logging',
// Plugins
'grails-plugin-domain-class',
'grails-plugin-url-mappings',
'grails-plugin-controllers',
- 'grails-plugin-logging',
+ 'grails-plugin-log4j',
'grails-plugin-mimetypes',
'grails-plugin-gsp',
'grails-plugin-filters',

0 comments on commit bf0c89f

Please sign in to comment.