From f13191e02c1b8e8e8857cadfcf29cfd15dd1f1ad Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 14:43:48 +0100 Subject: Handlers and testcases for @CommonsLog --- src/core/lombok/eclipse/handlers/HandleLog.java | 2 +- src/core/lombok/extern/apachecommons/CommonsLog.java | 4 ++++ src/core/lombok/javac/handlers/HandleLog.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index ee9986b1..0f77bf76 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -161,7 +161,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleCommonsLog extends EclipseAnnotationHandler { @Override public void handle(AnnotationValues annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.COMMONS, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.COMMONS, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/apachecommons/CommonsLog.java b/src/core/lombok/extern/apachecommons/CommonsLog.java index 024e3744..34ac0fe6 100644 --- a/src/core/lombok/extern/apachecommons/CommonsLog.java +++ b/src/core/lombok/extern/apachecommons/CommonsLog.java @@ -59,4 +59,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface CommonsLog { + /** + * 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 12aa07fb..2ad16b80 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -111,7 +111,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleCommonsLog extends JavacAnnotationHandler { @Override public void handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.COMMONS, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.COMMONS, annotation, annotationNode, annotation.getInstance().value()); } } -- cgit