aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok
diff options
context:
space:
mode:
authorMaarten Mulders <m.th.mulders@xs4all.nl>2014-02-08 20:24:23 +0100
committerMaarten Mulders <m.th.mulders@xs4all.nl>2014-02-08 20:24:23 +0100
commit1045006fa9d19c6daf51b2c200176ba789c2372f (patch)
tree4a00db4a32eb2a088c70c1b651e48b412db9cc48 /src/core/lombok
parentebc9ee5f6d6bc89af65d27f472d13f18b34bef18 (diff)
downloadlombok-1045006fa9d19c6daf51b2c200176ba789c2372f.tar.gz
lombok-1045006fa9d19c6daf51b2c200176ba789c2372f.tar.bz2
lombok-1045006fa9d19c6daf51b2c200176ba789c2372f.zip
Handler and testcases for @Log4j2
Diffstat (limited to 'src/core/lombok')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleLog.java2
-rw-r--r--src/core/lombok/extern/log4j/Log4j2.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 1cd933e3..583aa0af 100644
--- a/src/core/lombok/eclipse/handlers/HandleLog.java
+++ b/src/core/lombok/eclipse/handlers/HandleLog.java
@@ -191,7 +191,7 @@ public class HandleLog {
@ProviderFor(EclipseAnnotationHandler.class)
public static class HandleLog4j2Log extends EclipseAnnotationHandler<lombok.extern.log4j.Log4j2> {
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j2> annotation, Annotation source, EclipseNode annotationNode) {
- processAnnotation(LoggingFramework.LOG4J2, annotation, source, annotationNode, "");
+ processAnnotation(LoggingFramework.LOG4J2, annotation, source, annotationNode, annotation.getInstance().value());
}
}
diff --git a/src/core/lombok/extern/log4j/Log4j2.java b/src/core/lombok/extern/log4j/Log4j2.java
index 2a0f09e1..96fab793 100644
--- a/src/core/lombok/extern/log4j/Log4j2.java
+++ b/src/core/lombok/extern/log4j/Log4j2.java
@@ -59,4 +59,8 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Log4j2 {
+ /**
+ * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed.
+ */
+ String value() default "";
} \ No newline at end of file
diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java
index b01dd564..a5d12964 100644
--- a/src/core/lombok/javac/handlers/HandleLog.java
+++ b/src/core/lombok/javac/handlers/HandleLog.java
@@ -141,7 +141,7 @@ public class HandleLog {
@ProviderFor(JavacAnnotationHandler.class)
public static class HandleLog4j2Log extends JavacAnnotationHandler<lombok.extern.log4j.Log4j2> {
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j2> annotation, JCAnnotation ast, JavacNode annotationNode) {
- processAnnotation(LoggingFramework.LOG4J2, annotation, annotationNode, "");
+ processAnnotation(LoggingFramework.LOG4J2, annotation, annotationNode, annotation.getInstance().value());
}
}