From e1153c16562dba545f4cc2ecbc26befde6c1a781 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 15:16:39 +0100 Subject: Handler and testcases for @Log --- src/core/lombok/eclipse/handlers/HandleLog.java | 2 +- src/core/lombok/extern/java/Log.java | 4 ++++ src/core/lombok/javac/handlers/HandleLog.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index 0f77bf76..891d4df2 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -171,7 +171,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleJulLog extends EclipseAnnotationHandler { @Override public void handle(AnnotationValues annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.JUL, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.JUL, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/java/Log.java b/src/core/lombok/extern/java/Log.java index 7ae4e07b..dfa2e2aa 100644 --- a/src/core/lombok/extern/java/Log.java +++ b/src/core/lombok/extern/java/Log.java @@ -58,4 +58,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log { + /** + * 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 2ad16b80..bdb80ccb 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -121,7 +121,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleJulLog extends JavacAnnotationHandler { @Override public void handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.JUL, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.JUL, annotation, annotationNode, annotation.getInstance().value()); } } -- cgit