Class TaskListenerTraceWrapper
java.lang.Object
org.jenkinsci.plugins.pipeline.maven.util.TaskListenerTraceWrapper
This class provides methods which wrap the original
TaskListener
.
All trace*
methods check if traceability is enabled before doing anything.-
Constructor Summary
ConstructorDescriptionTaskListenerTraceWrapper
(TaskListener taskListener, boolean traceability) Wrap the given TaskListener. -
Method Summary
Modifier and TypeMethodDescriptionWrapsTaskListener.getLogger()
format calls.formatTrace
(String format, Object... args) WrapsTaskListener.getLogger()
format calls.void
WrapsTaskListener.getLogger()
println calls.void
Prints the given Object to the underlying TaskListener if traceability is enabled.void
Prints the given String to the underlying TaskListener if traceability is enabled.void
traceHyperlink
(String url, String text) Wraps theTaskListener.hyperlink(String, String)
function.
-
Constructor Details
-
TaskListenerTraceWrapper
Wrap the given TaskListener.- Parameters:
taskListener
- the wrapped listenertraceability
- the boolean flag for traceability
-
-
Method Details
-
trace
Prints the given String to the underlying TaskListener if traceability is enabled.- Parameters:
s
- the string to print
-
trace
Prints the given Object to the underlying TaskListener if traceability is enabled.- Parameters:
o
- the object to print
-
traceHyperlink
Wraps theTaskListener.hyperlink(String, String)
function. If traceability is disabled do nothing.- Parameters:
url
-TaskListener.hyperlink(java.lang.String, java.lang.String)
text
-TaskListener.hyperlink(java.lang.String, java.lang.String)
- Throws:
IOException
-
println
WrapsTaskListener.getLogger()
println calls.- Parameters:
s
- TheCharSequence
to be printed.
-
format
WrapsTaskListener.getLogger()
format calls. -
formatTrace
WrapsTaskListener.getLogger()
format calls. If traceability is disabled do nothing.
-