Class TTConsoleLogger
- java.lang.Object
-
- de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger
-
public class TTConsoleLogger extends Object
A helper class that offers various types of logging. Provides plain logging into console log and annotated logging withTTConsoleAnnotator
.
-
-
Constructor Summary
Constructors Constructor Description TTConsoleLogger(TaskListener listener)
Instantiates a newTTConsoleLogger
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrintStream
getLogger()
Gets the logger.void
log(String message)
Logs plain text messages directly into console.void
logAnnot(String message)
Logs annotated message.void
logAnnot(String prefix, String message)
Logs annotated message.void
logComException(Exception exception)
Logs error message caused by COM exception and prints stacktrace for debugging purposes.void
logComException(String message, Exception exception)
Logs custom error message with caused COM exception and prints stacktrace for debugging purposes.void
logDebug(String message)
Logs debug message.void
logError(String message)
Logs error message.void
logInfo(String message)
Logs info message.void
logStackTrace(Exception exception)
Logs an exception stacktrace as debug message.void
logWarn(String message)
Logs warning message.
-
-
-
Constructor Detail
-
TTConsoleLogger
public TTConsoleLogger(TaskListener listener)
Instantiates a newTTConsoleLogger
.- Parameters:
listener
- the listener
-
-
Method Detail
-
getLogger
public PrintStream getLogger()
Gets the logger.- Returns:
- the
PrintStream
logger
-
logAnnot
public void logAnnot(String message)
Logs annotated message.- Parameters:
message
- the message to log
-
logAnnot
public void logAnnot(String prefix, String message)
Logs annotated message.- Parameters:
prefix
- the prefixmessage
- message to be annotated
-
logInfo
public void logInfo(String message)
Logs info message.- Parameters:
message
- the message to log
-
logWarn
public void logWarn(String message)
Logs warning message.- Parameters:
message
- the message to log
-
logError
public void logError(String message)
Logs error message.- Parameters:
message
- the message to log
-
logComException
public void logComException(Exception exception)
Logs error message caused by COM exception and prints stacktrace for debugging purposes.- Parameters:
exception
- the exception
-
logComException
public void logComException(String message, Exception exception)
Logs custom error message with caused COM exception and prints stacktrace for debugging purposes.- Parameters:
exception
- the exceptionmessage
- the error message
-
logDebug
public void logDebug(String message)
Logs debug message. Can be enabled either by providing -Decutest.debugLog=true to Jenkins master JVM or setting system property ecutest.debugLog directly.- Parameters:
message
- the message to log
-
logStackTrace
public void logStackTrace(Exception exception)
Logs an exception stacktrace as debug message.- Parameters:
exception
- the exception
-
log
public void log(String message)
Logs plain text messages directly into console.- Parameters:
message
- message in plain text
-
-