Package io.jenkins.plugins.util
Class LogHandler
java.lang.Object
io.jenkins.plugins.util.LogHandler
Handles logging of issues log and error messages to a
TaskListener
instance.- Author:
- Ullrich Hafner
-
Constructor Summary
ConstructorDescriptionLogHandler
(TaskListener listener, String name) Creates a newLogHandler
.LogHandler
(TaskListener listener, String name, edu.hm.hafner.util.FilteredLog logger) Creates a newLogHandler
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
log
(edu.hm.hafner.util.FilteredLog logger) Log all info and error messages that are stored in the set of issues.void
Logs the specified message.void
logErrorMessages
(List<String> errorMessages) Logs the specified error messages.void
logInfoMessages
(List<String> infoMessages) Logs the specified information messages.void
setQuiet
(boolean quiet)
-
Constructor Details
-
LogHandler
Creates a newLogHandler
.- Parameters:
listener
- the task listener that will print all log messagesname
- the name of the logger
-
LogHandler
Creates a newLogHandler
.- Parameters:
listener
- the task listener that will print all log messagesname
- the name of the loggerlogger
- the logger that contains the actual log messages
-
-
Method Details
-
log
public void log(edu.hm.hafner.util.FilteredLog logger) Log all info and error messages that are stored in the set of issues. Note that subsequent calls to this method will only log messages that have not yet been logged.- Parameters:
logger
- the logger with the collected messages
-
log
Logs the specified message.- Parameters:
format
- A format stringargs
- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero.
-
logErrorMessages
Logs the specified error messages.- Parameters:
errorMessages
- the error messages to log
-
logInfoMessages
Logs the specified information messages.- Parameters:
infoMessages
- the information messages to log
-
setQuiet
public void setQuiet(boolean quiet)
-