mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 20:17:25 +00:00
Add access properties to logger annotations
This commit is contained in:
1 parent
13061ac02e
commit
392abe1003
9 files changed
+78
No files matched your search
@@ -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}.
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
Vendored
+9
@@ -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 "";
|
||||
}
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 "";
|
||||
}
|
||||
Reference in new issue
Block a user