public final class LogCaptor extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
clearLogs() |
static <T> LogCaptor |
forClass(Class<T> clazz)
Captures log messages for the provided class
|
static LogCaptor |
forName(String name)
Captures log messages for the provided logger name
|
static LogCaptor |
forRoot()
Captures all log messages
|
List<String> |
getDebugLogs() |
List<String> |
getErrorLogs() |
List<String> |
getInfoLogs() |
List<LogEvent> |
getLogEvents() |
List<String> |
getLogs() |
List<String> |
getTraceLogs() |
List<String> |
getWarnLogs() |
void |
resetLogLevel()
Resets the log level of the target logger to the initial value which was available before
changing it with
setLogLevelToInfo(), setLogLevelToDebug() or with setLogLevelToTrace() |
void |
setLogLevelToDebug()
Overrides the log level property of the target logger.
|
void |
setLogLevelToInfo()
Overrides the log level property of the target logger.
|
void |
setLogLevelToTrace()
Overrides the log level property of the target logger.
|
public static LogCaptor forRoot()
public static <T> LogCaptor forClass(Class<T> clazz)
public static LogCaptor forName(String name)
public void setLogLevelToInfo()
LogCaptor has been created.
To roll-back to the initial state use: resetLogLevel()
This option will implicitly include the following log levels: WARN and ERRORpublic void setLogLevelToDebug()
LogCaptor has been created.
To roll-back to the initial state use: resetLogLevel()
This option will implicitly include the following log levels: INFO, WARN and ERRORpublic void setLogLevelToTrace()
LogCaptor has been created.
To roll-back to the initial state use: resetLogLevel()
This option will implicitly include the following log levels: INFO, DEBUG, WARN and ERRORpublic void resetLogLevel()
setLogLevelToInfo(), setLogLevelToDebug() or with setLogLevelToTrace()public void clearLogs()
Copyright © 2020. All rights reserved.