@CheckReturnValue
public final class FakeLoggerBackend
extends com.google.common.flogger.backend.LoggerBackend
LogData instances logged to it. This class is
mutable and not thread safe.| Constructor and Description |
|---|
FakeLoggerBackend()
Returns a fake backend with a fixed name.
|
FakeLoggerBackend(java.lang.String name)
Returns a fake backend with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
LogDataSubject |
assertLastLogged()
Asserts about the most recent logged entry.
|
LogDataSubject |
assertLogged(int n)
Asserts about the
Nth logged entry. |
com.google.common.flogger.backend.LogData |
getLogged(int n)
Returns the
Nth LogData entry captured by this backend. |
int |
getLoggedCount()
Returns the number of
LogData entries captured by this backend. |
java.lang.String |
getLoggerName() |
void |
handleError(java.lang.RuntimeException error,
com.google.common.flogger.backend.LogData badData) |
boolean |
isLoggable(java.util.logging.Level loggedLevel) |
void |
log(com.google.common.flogger.backend.LogData data) |
void |
setLevel(java.util.logging.Level level)
Sets the current level of this backend.
|
public FakeLoggerBackend()
public FakeLoggerBackend(java.lang.String name)
public void setLevel(java.util.logging.Level level)
public int getLoggedCount()
LogData entries captured by this backend.public com.google.common.flogger.backend.LogData getLogged(int n)
Nth LogData entry captured by this backend.public LogDataSubject assertLogged(int n)
Nth logged entry.public LogDataSubject assertLastLogged()
public java.lang.String getLoggerName()
getLoggerName in class com.google.common.flogger.backend.LoggerBackendpublic boolean isLoggable(java.util.logging.Level loggedLevel)
isLoggable in class com.google.common.flogger.backend.LoggerBackendpublic void log(com.google.common.flogger.backend.LogData data)
log in class com.google.common.flogger.backend.LoggerBackendpublic void handleError(java.lang.RuntimeException error,
com.google.common.flogger.backend.LogData badData)
handleError in class com.google.common.flogger.backend.LoggerBackend