Package hudson.console
Class ConsoleLogFilter
java.lang.Object
hudson.console.ConsoleLogFilter
- All Implemented Interfaces:
ExtensionPoint
A hook to allow filtering of information that is written to the console log.
Unlike
ConsoleAnnotator and ConsoleNote, this class provides
direct access to the underlying OutputStream so it's possible to suppress
data, which isn't possible from the other interfaces.
(ArgumentListBuilder.add(String, boolean) is a simpler way to suppress a single password.)
Implementations which are Serializable may be sent to an agent JVM for processing.
In particular, this happens under JEP-210.
In this case, the implementation should not assume that JenkinsJVM.isJenkinsJVM(),
and if generating ConsoleNotes will need to encode them on the master side first.
- Since:
- 1.383
- Author:
- dty
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<ConsoleLogFilter>all()All the registeredConsoleLogFilters.decorateLogger(AbstractBuild build, OutputStream logger) Deprecated.as of 1.632.decorateLogger(Computer computer, OutputStream logger) Called to decorate logger for master/agent communication.decorateLogger(Run build, OutputStream logger) Called on the start of each build, giving extensions a chance to intercept the data that is written to the log.
-
Constructor Details
-
ConsoleLogFilter
public ConsoleLogFilter()
-
-
Method Details
-
decorateLogger
@Deprecated public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException Deprecated.as of 1.632. UsedecorateLogger(Run, OutputStream)Called on the start of each build, giving extensions a chance to intercept the data that is written to the log.- Throws:
AbstractMethodError- when a plugin overrides neither this method nordecorateLogger(Run, OutputStream).IOExceptionInterruptedException
-
decorateLogger
public OutputStream decorateLogger(Run build, OutputStream logger) throws IOException, InterruptedException Called on the start of each build, giving extensions a chance to intercept the data that is written to the log.Even though this method is not marked 'abstract', this is the method that must be overridden by extensions.
- Throws:
IOExceptionInterruptedException
-
decorateLogger
public OutputStream decorateLogger(@NonNull Computer computer, OutputStream logger) throws IOException, InterruptedException Called to decorate logger for master/agent communication.- Parameters:
computer- Agent computer for which the logger is getting decorated. Useful to do contextual decoration.- Throws:
IOExceptionInterruptedException- Since:
- 1.632
-
all
All the registeredConsoleLogFilters.
-