- Enclosing interface:
KeyValuesEnvironment
public static interface KeyValuesEnvironment.Logger
Key Values Resource focused logging facade and event capture. Logging level
condition checking is purposely not supplied as these are more like events and many
implementations will replay when the actual logging sytem loads.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
closed
(KeyValuesSystem system) This signals that key values system will no longer be used to load resources and that some other system can now take over perhaps the logging system.void
Logs a debug-level message.default void
This is to signal failure that the KeyValueSystem cannot recover from while attempting to load.static String
formatLevel
(System.Logger.Level level) Turns a Level into a SLF4J like level String that is all upper case and same length with right padding.void
Logs an info-level message.default void
init
(KeyValuesSystem system) When Key Values System is loaded.default void
load
(KeyValuesResource resource) Logs a debug message indicating that a resource is being loaded.default void
loaded
(KeyValuesResource resource) Logs an info message indicating that a resource has been successfully loaded.default void
missing
(KeyValuesResource resource, Exception exception) Logs a debug message indicating that a resource is missing.static KeyValuesEnvironment.Logger
of()
By default Ezkv does no logging because logging usually needs configuration loaded first (Ezkv in this case).static KeyValuesEnvironment.Logger
of
(System.Logger logger) Returns a logger that uses the suppliedSystem.Logger
.void
Logs an warn-level message.
-
Method Details
-
of
Returns a logger that uses the suppliedSystem.Logger
. Becareful using this because something downstream may need to configure the system logger based on Ezkv config.- Parameters:
logger
- system logger.- Returns:
- logger.
-
of
By default Ezkv does no logging because logging usually needs configuration loaded first (Ezkv in this case).- Returns:
- noop logger.
-
init
When Key Values System is loaded.- Parameters:
system
- that was just created.
-
debug
Logs a debug-level message.- Parameters:
message
- the message to log
-
info
Logs an info-level message.- Parameters:
message
- the message to log
-
warn
Logs an warn-level message.- Parameters:
message
- the message to log
-
load
Logs a debug message indicating that a resource is being loaded.- Parameters:
resource
- the resource being loaded
-
loaded
Logs an info message indicating that a resource has been successfully loaded.- Parameters:
resource
- the loaded resource
-
missing
Logs a debug message indicating that a resource is missing.- Parameters:
resource
- the resource that was not foundexception
- the exception that occurred when the resource was not found
-
closed
This signals that key values system will no longer be used to load resources and that some other system can now take over perhaps the logging system.- Parameters:
system
- key value system that was closed.
-
fatal
This is to signal failure that the KeyValueSystem cannot recover from while attempting to load.- Parameters:
exception
- unrecoverable key values exception
-
formatLevel
Turns a Level into a SLF4J like level String that is all upper case and same length with right padding.System.Logger.Level.ALL
is "TRACE
",System.Logger.Level.OFF
is "ERROR
" andSystem.Logger.Level.WARNING
is "WARN
".- Parameters:
level
- system logger level.- Returns:
- upper case string of level.
-