Package elf4j.engine.service.pattern
Class ClassPattern
- java.lang.Object
-
- elf4j.engine.service.pattern.ClassPattern
-
- All Implemented Interfaces:
LogPattern,PerformanceSensitive
public class ClassPattern extends Object implements LogPattern
-
-
Constructor Summary
Constructors Constructor Description ClassPattern()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClassPatternfrom(@NonNull String patternSegment)booleanincludeCallerDetail()booleanincludeCallerThread()voidrender(@NonNull LogEvent logEvent, StringBuilder target)Extracts the content of particular interest to this log pattern instance from the specified log event, and appends the result to the specified target aggregator of the final log message
-
-
-
Method Detail
-
from
@Nonnull public static ClassPattern from(@NonNull @NonNull String patternSegment)
- Parameters:
patternSegment- text patternSegment to convert- Returns:
- converted patternSegment object
-
includeCallerDetail
public boolean includeCallerDetail()
- Specified by:
includeCallerDetailin interfacePerformanceSensitive- Returns:
falseassuming the logger's owner class is the same as the caller class. Therefore, unlike theMethodPattern, it does not take a stack trace walk to locate the caller class - the owner class is taken instead.
-
includeCallerThread
public boolean includeCallerThread()
- Specified by:
includeCallerThreadin interfacePerformanceSensitive- Returns:
- true if log should include call thread information such thread name and id
-
render
public void render(@NonNull @NonNull LogEvent logEvent, StringBuilder target)Description copied from interface:LogPatternExtracts the content of particular interest to this log pattern instance from the specified log event, and appends the result to the specified target aggregator of the final log message- Specified by:
renderin interfaceLogPattern- Parameters:
logEvent- entire log content data source to rendertarget- logging text aggregator of the final log message
-
-