Class StandardLogger
- All Implemented Interfaces:
Logger
Logger
implementation returned by Logger.create()
.- Since:
- 2.10
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
System propertyorg.omegazero.common.logging.stackTraces.classSource
static final boolean
System propertyorg.omegazero.common.logging.stackTraces.classSourceFull
static final boolean
System propertyorg.omegazero.common.logging.stackTraces.xstVerbose
-
Method Summary
Modifier and TypeMethodDescriptionReturns the full name of the class thisStandardLogger
is bound to.getLabel()
Returns the label used to identify thisLogger
in log messages.boolean
Checks if thisLogger
prints log messages, taking into account the configured log level and other logger settings.void
Constructs a log message from the given objects and outputs it at the given log level.static void
printStackTrace
(Throwable throwable, Consumer<String> println) Prints a stack trace of the giventhrowable
to the givenConsumer
.
-
Field Details
-
ENABLE_ST_CLASS_SOURCE
public static final boolean ENABLE_ST_CLASS_SOURCESystem propertyorg.omegazero.common.logging.stackTraces.classSource
Enables 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.classSourceFull
If
ENABLE_ST_CLASS_SOURCE
istrue
, 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.xstVerbose
Enables verbose logging of stack frames using the
co.paralleluniverse:extended-stacktrace
library, if available.Default:
false
- Since:
- 2.11.0
-
-
Method Details
-
printStackTrace
Prints a stack trace of the giventhrowable
to the givenConsumer
. Used by thisStandardLogger
to 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
- TheThrowable
println
- The output consumer
-
log
Description copied from interface:Logger
Constructs a log message from the given objects and outputs it at the given log level. -
getLabel
Returns the label used to identify thisLogger
in log messages.This is the short name of the class this
StandardLogger
is bound to. -
isLogging
Description copied from interface:Logger
Checks if thisLogger
prints log messages, taking into account the configured log level and other logger settings. -
getFullClassName
Returns the full name of the class thisStandardLogger
is bound to.- Returns:
- The full class name
- Since:
- 2.5
-