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 String
asString()
void
clear()
static MemoLogger
copyingToConsoleLogger(String consolePrefix, org.apache.log4j.Level level)
static MemoLogger
copyingToConsoleLogger(org.apache.log4j.Level level)
void
debug(String message)
void
debug(String message, Throwable exception)
void
error(String message, Throwable exception, String... details)
String
getErrors()
List<String>
getErrorsList()
String
getErrorsOrWarnings()
boolean
hasErrors()
boolean
hasErrorsOrWarnings()
boolean
hasLinesContains(String substr)
boolean
hasLinesMatches(String pattern)
void
info(String message)
void
info(String message, Throwable exception)
boolean
isDebugEnabled()
boolean
isTraceEnabled()
protected void
remember(String prefix, String message, Throwable exception)
void
setLevel(org.apache.log4j.Level level)
void
warn(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:
isDebugEnabled
in classLogger
-
isTraceEnabled
public boolean isTraceEnabled()
- Overrides:
isTraceEnabled
in classLogger
-
-