java.lang.Object
com.renomad.minum.logging.Logger
com.renomad.minum.logging.TestLogger
- All Implemented Interfaces:
ILogger
This implementation of
Logger
has a few
extra functions that only apply to tests, like test(String)
-
Field Summary
Fields inherited from class com.renomad.minum.logging.Logger
loggingActionQueue
-
Constructor Summary
ConstructorDescriptionTestLogger
(Constants constants, ExecutorService executorService, String name) SeeTestLogger
-
Method Summary
Modifier and TypeMethodDescriptionboolean
doesMessageExist
(String value) Whether the given string exists in the log messages.boolean
doesMessageExist
(String value, int lines) Whether the given string exists in the log messages.Looks back through the last 3 log messages for one that contains the provided value.findFirstMessageThatContains
(String value, int lines) Provides an ability to search over the recent past log messages, case-insensitively.int
void
Logs helpful debugging information inside threadsvoid
This is for logging business-related topicsvoid
Logs helpful debugging informationvoid
Logs helpful debugging informationvoid
A helper function to log a test title prefixed with "TEST:"
Also collects data about the previously-run testtoString()
Methods inherited from class com.renomad.minum.logging.Logger
getActiveLogLevels, stop
-
Field Details
-
MAX_CACHE_SIZE
public static final int MAX_CACHE_SIZE- See Also:
-
-
Constructor Details
-
TestLogger
SeeTestLogger
-
-
Method Details
-
logDebug
Description copied from interface:ILogger
Logs helpful debugging information -
logTrace
Description copied from interface:ILogger
Logs helpful debugging informationSimilar to
ILogger.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.
-
logAudit
Description copied from interface:ILogger
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" -
logAsyncError
Description copied from interface:ILogger
Logs helpful debugging information inside threads- Specified by:
logAsyncError
in interfaceILogger
- Overrides:
logAsyncError
in classLogger
- Parameters:
msg
- a lambda for what is to be logged. example: () -> "Hello"
-
findFirstMessageThatContains
Provides an ability to search over the recent past log messages, case-insensitively.- Parameters:
lines
- number of lines of log messages to look back through, up toMAX_CACHE_SIZE
-
doesMessageExist
Whether the given string exists in the log messages. May exist multiple times.- Parameters:
value
- a string to search in the loglines
- how many lines back to examine- Returns:
- whether this string was found, even if there were multiple places it was found.
-
doesMessageExist
Whether the given string exists in the log messages. May exist multiple times.- Parameters:
value
- a string to search in the log- Returns:
- whether or not this string was found, even if there were multiple places it was found.
-
findFirstMessageThatContains
Looks back through the last 3 log messages for one that contains the provided value. Returns the whole line if found and an exception if not found.See
findFirstMessageThatContains(String, int)
if you want to search through more than 3. However, it is only possible to search up toMAX_CACHE_SIZE
-
test
A helper function to log a test title prefixed with "TEST:"
Also collects data about the previously-run test -
getTestCount
public int getTestCount() -
toString
-