Skip to content

Commit

Permalink
Add support for Log4j2 to logging.dsld
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Jun 10, 2017
1 parent 350be3b commit 594e91b
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 224 deletions.
55 changes: 23 additions & 32 deletions base/org.codehaus.groovy18/plugin_dsld_support/dsld/logging.dsld
@@ -1,52 +1,43 @@
/*
* Copyright 2011 SpringSource and others
* Copyright 2009-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Hackergarten contribution
*
* @author Lukasz Pielak
* @author Max Rydahl Andersen
* @author Tom Bujok (reficio.org)
* @author Andres Almiray
*/
package dsld

[
[
annotation: 'groovy.util.logging.Log',
logger: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
logger: 'org.slf4j.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
logger: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
logger: 'org.apache.log4j.Logger'
]
[
annotation: 'groovy.util.logging.Log',
loggerType: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
loggerType: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
loggerType: 'org.apache.log4j.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
loggerType: 'org.slf4j.Logger'
]
].each { data ->
contribute(currentType(annotations: annotatedBy(data.annotation))) {
for(annotationNode in annotations) {
provider = 'Logging AST Transformations'
def name = annotationNode.getMember('value') ?: 'log'
property name: name,
type: data.logger
}
provider = 'Logging AST Transform'
for (annotationNode in annotations) {
def loggerName = annotationNode.getMember('value') ?: 'log'
property name: loggerName, type: data.loggerType, isStatic: true // also final, private, transient
}
}
}
55 changes: 23 additions & 32 deletions base/org.codehaus.groovy20/plugin_dsld_support/dsld/logging.dsld
@@ -1,52 +1,43 @@
/*
* Copyright 2011 SpringSource and others
* Copyright 2009-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Hackergarten contribution
*
* @author Lukasz Pielak
* @author Max Rydahl Andersen
* @author Tom Bujok (reficio.org)
* @author Andres Almiray
*/
package dsld

[
[
annotation: 'groovy.util.logging.Log',
logger: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
logger: 'org.slf4j.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
logger: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
logger: 'org.apache.log4j.Logger'
]
[
annotation: 'groovy.util.logging.Log',
loggerType: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
loggerType: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
loggerType: 'org.apache.log4j.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
loggerType: 'org.slf4j.Logger'
]
].each { data ->
contribute(currentType(annotations: annotatedBy(data.annotation))) {
for(annotationNode in annotations) {
provider = 'Logging AST Transformations'
def name = annotationNode.getMember('value') ?: 'log'
property name: name,
type: data.logger
}
provider = 'Logging AST Transform'
for (annotationNode in annotations) {
def loggerName = annotationNode.getMember('value') ?: 'log'
property name: loggerName, type: data.loggerType, isStatic: true // also final, private, transient
}
}
}
55 changes: 23 additions & 32 deletions base/org.codehaus.groovy21/plugin_dsld_support/dsld/logging.dsld
@@ -1,52 +1,43 @@
/*
* Copyright 2011 SpringSource and others
* Copyright 2009-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Hackergarten contribution
*
* @author Lukasz Pielak
* @author Max Rydahl Andersen
* @author Tom Bujok (reficio.org)
* @author Andres Almiray
*/
package dsld

[
[
annotation: 'groovy.util.logging.Log',
logger: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
logger: 'org.slf4j.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
logger: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
logger: 'org.apache.log4j.Logger'
]
[
annotation: 'groovy.util.logging.Log',
loggerType: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
loggerType: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
loggerType: 'org.apache.log4j.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
loggerType: 'org.slf4j.Logger'
]
].each { data ->
contribute(currentType(annotations: annotatedBy(data.annotation))) {
for(annotationNode in annotations) {
provider = 'Logging AST Transformations'
def name = annotationNode.getMember('value') ?: 'log'
property name: name,
type: data.logger
}
provider = 'Logging AST Transform'
for (annotationNode in annotations) {
def loggerName = annotationNode.getMember('value') ?: 'log'
property name: loggerName, type: data.loggerType, isStatic: true // also final, private, transient
}
}
}
59 changes: 27 additions & 32 deletions base/org.codehaus.groovy22/plugin_dsld_support/dsld/logging.dsld
@@ -1,52 +1,47 @@
/*
* Copyright 2011 SpringSource and others
* Copyright 2009-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Hackergarten contribution
*
* @author Lukasz Pielak
* @author Max Rydahl Andersen
* @author Tom Bujok (reficio.org)
* @author Andres Almiray
*/
package dsld

[
[
annotation: 'groovy.util.logging.Log',
logger: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
logger: 'org.slf4j.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
logger: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
logger: 'org.apache.log4j.Logger'
]
[
annotation: 'groovy.util.logging.Log',
loggerType: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
loggerType: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
loggerType: 'org.apache.log4j.Logger'
],
[
annotation: 'groovy.util.logging.Log4j2',
loggerType: 'org.apache.logging.log4j.core.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
loggerType: 'org.slf4j.Logger'
]
].each { data ->
contribute(currentType(annotations: annotatedBy(data.annotation))) {
for(annotationNode in annotations) {
provider = 'Logging AST Transformations'
def name = annotationNode.getMember('value') ?: 'log'
property name: name,
type: data.logger
}
provider = 'Logging AST Transform'
for (annotationNode in annotations) {
def loggerName = annotationNode.getMember('value') ?: 'log'
property name: loggerName, type: data.loggerType, isStatic: true // also final, private, transient
}
}
}
59 changes: 27 additions & 32 deletions base/org.codehaus.groovy23/plugin_dsld_support/dsld/logging.dsld
@@ -1,52 +1,47 @@
/*
* Copyright 2011 SpringSource and others
* Copyright 2009-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Hackergarten contribution
*
* @author Lukasz Pielak
* @author Max Rydahl Andersen
* @author Tom Bujok (reficio.org)
* @author Andres Almiray
*/
package dsld

[
[
annotation: 'groovy.util.logging.Log',
logger: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
logger: 'org.slf4j.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
logger: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
logger: 'org.apache.log4j.Logger'
]
[
annotation: 'groovy.util.logging.Log',
loggerType: 'java.util.logging.Logger'
],
[
annotation: 'groovy.util.logging.Commons',
loggerType: 'org.apache.commons.logging.Log'
],
[
annotation: 'groovy.util.logging.Log4j',
loggerType: 'org.apache.log4j.Logger'
],
[
annotation: 'groovy.util.logging.Log4j2',
loggerType: 'org.apache.logging.log4j.core.Logger'
],
[
annotation: 'groovy.util.logging.Slf4j',
loggerType: 'org.slf4j.Logger'
]
].each { data ->
contribute(currentType(annotations: annotatedBy(data.annotation))) {
for(annotationNode in annotations) {
provider = 'Logging AST Transformations'
def name = annotationNode.getMember('value') ?: 'log'
property name: name,
type: data.logger
}
provider = 'Logging AST Transform'
for (annotationNode in annotations) {
def loggerName = annotationNode.getMember('value') ?: 'log'
property name: loggerName, type: data.loggerType, isStatic: true // also final, private, transient
}
}
}

0 comments on commit 594e91b

Please sign in to comment.