Class LoggingAdapter
Ordinarily we'd use SLF4J and call it a day. However, as picoresolve
is developed to have the fewest dependencies possible, picoresolve
will abstract away the logging into the LoggingAdapter interface,
allowing logging to function even when SLF4J is not present on the classpath.
The default implementation uses SLF4J as the log sink if it exists,
otherwise it will fall back to using JUL as the logger, as defined by
Logger.
This facade should support "standard" SLF4J placeholders via "{}".
Not all arguments may map to a placeholder and in case they do not then they
should simply be appended to the end of the message. Leftover "{}"
placeholders need to be kept as-is. Implementations of this interface
are free to assume that "{}" never need to be escaped and that likewise no
indexing occurs (e.g. that "{2}" should never happen). If the last
argument is a Throwable, it's stacktrace should be logged.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabstract voidstatic @NotNull LoggingAdapterabstract voidstatic voidsetDefaultLogger(@NotNull LoggingAdapter instance) abstract void
-
Constructor Details
-
LoggingAdapter
public LoggingAdapter()
-
-
Method Details
-
getDefaultLogger
-
setDefaultLogger
-
debug
-
error
-
info
-
warn
-