Annotation Interface Logged
strategy()
to
flag a class as logging everything it can, except for those elements tagged with
@Logged(importance = NONE)
; or for logging only specific items also tagged with
@Logged
.
Logged fields may have any access modifier. Logged methods must be public; non-public methods will be ignored.
Epilogue can log all primitive types, arrays of primitive types (except char and short), Strings, arrays of Strings, sendable objects, objects with a struct serializer, and arrays of objects with struct serializers.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Data importance.static enum
Different behaviors for how Epilogue will generate the names of logged data points.static enum
Opt-in or opt-out strategies for logging. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe default naming behavior to use.The importance of the annotated data.The name for the annotated element to be logged as.The strategy to use for logging.
-
Element Details
-
name
The name for the annotated element to be logged as. Does nothing on class-level annotations. Fields and methods will default to be logged using their in-code names; use this attribute to set it to something custom.If the annotation is placed on a class, the specified name will not change logged data (since that uses the names of the specific usages of the class in fields and methods); however, it will be used to set the names of the generated logger that Logged will use to log instances of the class. This can be used to avoid name conflicts if you have multiple classes with the same name, but in different packages, and want to be able to log both.
- Returns:
- the name to use to log the field or method under; or the name of the generated class-specific logger
- Default:
- ""
-
strategy
The strategy to use for logging. Only has an effect on annotations on class or interface declarations.- Returns:
- the strategy to use to determine which fields and methods in the class to log
- Default:
- OPT_OUT
-
importance
The importance of the annotated data. If placed on a class or interface, this will be the default importance of all data within that class; this can be overridden on a per-element basis by annotating fields and methods with their own@Logged(importance = ...)
annotation.- Returns:
- the importance of the annotated element
- Default:
- DEBUG
-
defaultNaming
The default naming behavior to use. Defaults toLogged.Naming.USE_CODE_NAME
, which uses the raw code name directly in logs. Any configuration of thename()
attribute on logged fields and methods will take precedence over an automatically generated name.- Returns:
- the naming strategy for and annotated field or method, or the default naming strategy for all logged fields and methods in an annotated class
- Default:
- USE_CODE_NAME
-