Add access properties to logger annotations

This commit is contained in:
Liam Pace authored and Reinier Zwitserloot committed 2025-09-17 22:24:00 +02:00
1 parent 13061ac02e
commit 392abe1003
9 files changed
+78

No files matched your search

+7
View File
@@ -65,6 +65,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface CustomLog {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/**
*
* Sets a custom topic/category. Note that this requires you to specify a parameter configuration for your custom logger that includes {@code TOPIC}.
+9
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -62,6 +64,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface CommonsLog {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */
String topic() default "";
}
+8
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -60,4 +62,10 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Flogger {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
}
+9
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -61,6 +63,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Log {
/**
* If you want your logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */
String topic() default "";
}
+9
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -61,6 +63,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface JBossLog {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */
String topic() default "";
}
+9
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -62,6 +64,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Log4j {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */
String topic() default "";
}
+9
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -62,6 +64,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Log4j2 {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */
String topic() default "";
}
+9
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -61,6 +63,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface Slf4j {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */
String topic() default "";
}
+9
View File
@@ -26,6 +26,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import lombok.AccessLevel;
/**
* Causes lombok to generate a logger field.
* <p>
@@ -61,6 +63,13 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface XSlf4j {
/**
* If you want your Logger to be non-private, you can specify an alternate access level here.
*
* @return The constructed Logger method will be generated with this access modifier.
*/
AccessLevel access() default AccessLevel.PRIVATE;
/** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */
String topic() default "";
}