Class StandardLogger
- All Implemented Interfaces:
Logger
Logger implementation returned by Logger.create().- Since:
- 2.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanSystem propertyorg.omegazero.common.logging.stackTraces.classSourcestatic final booleanSystem propertyorg.omegazero.common.logging.stackTraces.classSourceFullstatic final booleanSystem propertyorg.omegazero.common.logging.stackTraces.xstVerbose -
Method Summary
Modifier and TypeMethodDescriptionReturns the full name of the class thisStandardLoggeris bound to.getLabel()Returns the label used to identify thisLoggerin log messages.booleanChecks if thisLoggerprints log messages, taking into account the configured log level and other logger settings.voidConstructs a log message from the given objects and outputs it at the given log level.static voidprintStackTrace(Throwable throwable, Consumer<String> println) Prints a stack trace of the giventhrowableto the givenConsumer.
-
Field Details
-
ENABLE_ST_CLASS_SOURCE
public static final boolean ENABLE_ST_CLASS_SOURCESystem propertyorg.omegazero.common.logging.stackTraces.classSourceEnables logging of the source directory or JAR file of the class in each stack frame in stack traces.
Default:
true- Since:
- 2.11.0
-
ENABLE_ST_CLASS_SOURCE_FULL
public static final boolean ENABLE_ST_CLASS_SOURCE_FULLSystem propertyorg.omegazero.common.logging.stackTraces.classSourceFullIf
ENABLE_ST_CLASS_SOURCEistrue, enables logging of the full source path, instead of just the file name.Default:
false- Since:
- 2.11.0
-
ENABLE_XST_VERBOSE
public static final boolean ENABLE_XST_VERBOSESystem propertyorg.omegazero.common.logging.stackTraces.xstVerboseEnables verbose logging of stack frames using the
co.paralleluniverse:extended-stacktracelibrary, if available.Default:
false- Since:
- 2.11.0
-
-
Method Details
-
printStackTrace
Prints a stack trace of the giventhrowableto the givenConsumer. Used by thisStandardLoggerto print stack traces.The consumer is called for each line output.
This method has an output format similar to
Throwable.printStackTrace(). It also attempts to find and output additional information about each stack frame, for example the source directory or JAR file of the class file. This behavior may be configured using system properties defined in this class, for exampleENABLE_ST_CLASS_SOURCE.- Parameters:
throwable- TheThrowableprintln- The output consumer
-
log
Description copied from interface:LoggerConstructs a log message from the given objects and outputs it at the given log level. -
getLabel
Returns the label used to identify thisLoggerin log messages.This is the short name of the class this
StandardLoggeris bound to. -
isLogging
Description copied from interface:LoggerChecks if thisLoggerprints log messages, taking into account the configured log level and other logger settings. -
getFullClassName
Returns the full name of the class thisStandardLoggeris bound to.- Returns:
- The full class name
- Since:
- 2.5
-