Package jetbrains.buildServer.util
Class MemoLogger
- java.lang.Object
-
- com.intellij.openapi.diagnostic.Logger
-
- jetbrains.buildServer.util.MemoLogger
-
public class MemoLogger extends Logger
Logger that writes all records into a list of strings and can delegate to the another logger. Just for tests.- Since:
- 7.1
- Author:
- Leonid Bushuev from JetBrains
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.intellij.openapi.diagnostic.Logger
Logger.Factory, Logger.MessageSupplier
-
-
Field Summary
-
Fields inherited from class com.intellij.openapi.diagnostic.Logger
ALWAYS_SHOW_EXCEPTION_DETAILS_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description MemoLogger()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringasString()voidclear()static MemoLoggercopyingToConsoleLogger(String consolePrefix, org.apache.log4j.Level level)static MemoLoggercopyingToConsoleLogger(org.apache.log4j.Level level)voiddebug(String message)voiddebug(String message, Throwable exception)voiderror(String message, Throwable exception, String... details)StringgetErrors()List<String>getErrorsList()StringgetErrorsOrWarnings()booleanhasErrors()booleanhasErrorsOrWarnings()booleanhasLinesContains(String substr)booleanhasLinesMatches(String pattern)voidinfo(String message)voidinfo(String message, Throwable exception)booleanisDebugEnabled()booleanisTraceEnabled()protected voidremember(String prefix, String message, Throwable exception)voidsetLevel(org.apache.log4j.Level level)voidwarn(String message, Throwable exception)-
Methods inherited from class com.intellij.openapi.diagnostic.Logger
assertTrue, assertTrue, debug, debug, debug, error, error, error, error, error, getInstance, getInstance, info, info, infoAndDebugDetails, infoAndDebugDetails, setFactory, warn, warn, warnAndDebugDetails
-
-
-
-
Method Detail
-
copyingToConsoleLogger
public static MemoLogger copyingToConsoleLogger(String consolePrefix, org.apache.log4j.Level level)
-
copyingToConsoleLogger
public static MemoLogger copyingToConsoleLogger(org.apache.log4j.Level level)
-
clear
public void clear()
-
asString
@NotNull public String asString()
-
remember
protected void remember(@NotNull String prefix, @Nullable String message, @Nullable Throwable exception)
-
hasErrors
public boolean hasErrors()
-
hasErrorsOrWarnings
public boolean hasErrorsOrWarnings()
-
getErrors
public String getErrors()
-
getErrorsOrWarnings
public String getErrorsOrWarnings()
-
hasLinesContains
public boolean hasLinesContains(@NotNull String substr)
-
hasLinesMatches
public boolean hasLinesMatches(@NotNull String pattern)
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabledin classLogger
-
isTraceEnabled
public boolean isTraceEnabled()
- Overrides:
isTraceEnabledin classLogger
-
-