diff options
author | Maarten Mulders <m.th.mulders@xs4all.nl> | 2014-02-08 15:38:54 +0100 |
---|---|---|
committer | Maarten Mulders <m.th.mulders@xs4all.nl> | 2014-02-08 15:38:54 +0100 |
commit | ebc9ee5f6d6bc89af65d27f472d13f18b34bef18 (patch) | |
tree | 9be2954d407f02768a65e2eda6a3e11616aeb509 /src | |
parent | e1153c16562dba545f4cc2ecbc26befde6c1a781 (diff) | |
download | lombok-ebc9ee5f6d6bc89af65d27f472d13f18b34bef18.tar.gz lombok-ebc9ee5f6d6bc89af65d27f472d13f18b34bef18.tar.bz2 lombok-ebc9ee5f6d6bc89af65d27f472d13f18b34bef18.zip |
Handler and testcases for @Log4j
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleLog.java | 2 | ||||
-rw-r--r-- | src/core/lombok/extern/log4j/Log4j.java | 4 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleLog.java | 2 |
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 891d4df2..1cd933e3 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -181,7 +181,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleLog4jLog extends EclipseAnnotationHandler<lombok.extern.log4j.Log4j> { @Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j> annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.LOG4J, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.LOG4J, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/log4j/Log4j.java b/src/core/lombok/extern/log4j/Log4j.java index 29e1b27c..0fe74599 100644 --- a/src/core/lombok/extern/log4j/Log4j.java +++ b/src/core/lombok/extern/log4j/Log4j.java @@ -59,4 +59,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log4j { + /** + * 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 bdb80ccb..b01dd564 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -131,7 +131,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleLog4jLog extends JavacAnnotationHandler<lombok.extern.log4j.Log4j> { @Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j> annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.LOG4J, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.LOG4J, annotation, annotationNode, annotation.getInstance().value()); } } |