aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaarten Mulders <m.th.mulders@xs4all.nl>2014-02-08 20:35:56 +0100
committerMaarten Mulders <m.th.mulders@xs4all.nl>2014-02-08 20:35:56 +0100
commitc0e00edb7bf369470c55d59307bbf80cc3abb9d9 (patch)
tree3243e425833f1f084575b4c148fabb57afd11d81 /src
parent1045006fa9d19c6daf51b2c200176ba789c2372f (diff)
downloadlombok-c0e00edb7bf369470c55d59307bbf80cc3abb9d9.tar.gz
lombok-c0e00edb7bf369470c55d59307bbf80cc3abb9d9.tar.bz2
lombok-c0e00edb7bf369470c55d59307bbf80cc3abb9d9.zip
Handler and testcases for @XSlf4j
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleLog.java2
-rw-r--r--src/core/lombok/extern/slf4j/XSlf4j.java4
-rw-r--r--src/core/lombok/javac/handlers/HandleLog.java2
3 files changed, 6 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java
index 583aa0af..56160b39 100644
--- a/src/core/lombok/eclipse/handlers/HandleLog.java
+++ b/src/core/lombok/eclipse/handlers/HandleLog.java
@@ -211,7 +211,7 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleXSlf4jLog extends EclipseAnnotationHandler<lombok.extern.slf4j.XSlf4j> {
@Override public void handle(AnnotationValues<lombok.extern.slf4j.XSlf4j> annotation, Annotation source, EclipseNode annotationNode) {
- processAnnotation(LoggingFramework.XSLF4J, annotation, source, annotationNode, "");
+ processAnnotation(LoggingFramework.XSLF4J, annotation, source, annotationNode, annotation.getInstance().value());
}
}
diff --git a/src/core/lombok/extern/slf4j/XSlf4j.java b/src/core/lombok/extern/slf4j/XSlf4j.java
index 599c68ab..306057f0 100644
--- a/src/core/lombok/extern/slf4j/XSlf4j.java
+++ b/src/core/lombok/extern/slf4j/XSlf4j.java
@@ -57,4 +57,8 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface XSlf4j {
+ /**
+ * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed.
+ */
+ String value() default "";
}
diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java
index a5d12964..12b0cb5c 100644
--- a/src/core/lombok/javac/handlers/HandleLog.java
+++ b/src/core/lombok/javac/handlers/HandleLog.java
@@ -161,7 +161,7 @@ public class HandleLog {
@ProviderFor(JavacAnnotationHandler.class)
public static class HandleXSlf4jLog extends JavacAnnotationHandler<lombok.extern.slf4j.XSlf4j> {
@Override public void handle(AnnotationValues<lombok.extern.slf4j.XSlf4j> annotation, JCAnnotation ast, JavacNode annotationNode) {
- processAnnotation(LoggingFramework.XSLF4J, annotation, annotationNode, "");
+ processAnnotation(LoggingFramework.XSLF4J, annotation, annotationNode, annotation.getInstance().value());
}
}