- All Known Implementing Classes:
Logger,TestLogger
public interface ILogger
Logging code interface
-
Method Summary
Modifier and TypeMethodDescriptionThis method can be used to adjust the active log levels, which is a mapping of keys ofLoggingLevelto boolean values.voidLogs helpful debugging information inside threadsvoidThis is for logging business-related topicsvoidLogs helpful debugging informationvoidLogs helpful debugging informationvoidstop()When we are shutting down the system it is necessary to explicitly stop the logger.
-
Method Details
-
logDebug
Logs helpful debugging information- Parameters:
msg- a lambda for what is to be logged. example: () -> "Hello"
-
logTrace
Logs helpful debugging informationSimilar to
logDebug(ThrowingSupplier)but used for code that runs very often, requires extra calculation, or has data of large size.It is possible to disable trace logs and thus avoid performance impacts unless the data is needed for deeper investigation.
- Parameters:
msg- a lambda for what is to be logged. example: () -> "Hello"
-
logAsyncError
Logs helpful debugging information inside threads- Parameters:
msg- a lambda for what is to be logged. example: () -> "Hello"
-
logAudit
This is for logging business-related topicsThis log type is expected to be printed least-often, and should directly relate to a user action. An example would be "New user created: alice"
msg a lambda for what is to be logged. example: () -> "Hello" -
stop
void stop()When we are shutting down the system it is necessary to explicitly stop the logger.The logger has to stand apart from the rest of the system, or else we'll have circular dependencies.
-
getActiveLogLevels
Map<LoggingLevel,Boolean> getActiveLogLevels()This method can be used to adjust the active log levels, which is a mapping of keys ofLoggingLevelto boolean values. If the boolean value is true, that level of logging is enabled.
-