diff --git a/src/main/java/jenkins/plugins/logstash/LogstashConsoleLogFilter.java b/src/main/java/jenkins/plugins/logstash/LogstashConsoleLogFilter.java index dae097a1..0717ef30 100644 --- a/src/main/java/jenkins/plugins/logstash/LogstashConsoleLogFilter.java +++ b/src/main/java/jenkins/plugins/logstash/LogstashConsoleLogFilter.java @@ -28,26 +28,26 @@ public LogstashConsoleLogFilter(Run run) private static final long serialVersionUID = 1L; + /** + * {@inheritDoc} + * + * Currently pipeline is not supporting global ConsoleLogFilters. So even when we have it enabled globally + * we would not log to an indexer without the logstash step. + * But when pipeline supports global ConsoleLogFilters we don't want to log twice when we have the step in + * the pipeline. + * With the LogstashMarkerRunAction we can detect if it is enabled globally and if pipeline is supporting + * global ConsoleLogFilters. + * The LogstashMarkerRunAction will be only attached to a WorkflowRun when pipeline supports global + * ConsoleLogFilters (JENKINS-45693). And the assumption is that the marker action is attached before the + * logstashStep is initialized. + * This marker action will also disable the notifier. + * + */ @Override public OutputStream decorateLogger(Run build, OutputStream logger) throws IOException, InterruptedException { - /* - * Currently pipeline is not supporting global ConsoleLogFilters. So even when we have it enabled globally - * we would not log to an indexer without the logstash step. - * But when pipeline supports global ConsoleLogFilters we don't want to log twice when we have the step in - * the pipeline. - * With the LogstashMarkerRunAction we can detect if it is enabled globally and if pipeline is supporting - * global ConsoleLogFilters. - * The LogstashMarkerRunAction will be only attached to a WorkflowRun when pipeline supports global - * ConsoleLogFilters (JENKINS-45693). And the assumption is that the marker action is attached before the - * logstashStep is initialized. - * This marker action will also disable the notifier. - * - */ - - /* - * A pipeline step uses the constructor which sets run. - */ + + // A pipeline step uses the constructor which sets run. if (run != null) { if (run.getAction(LogstashMarkerAction.class) != null) @@ -59,10 +59,7 @@ public OutputStream decorateLogger(Run build, OutputStream logger) throws IOExce return getLogstashOutputStream(run, logger); } - /* - * Not pipeline step so @{code build} should be set. - * - */ + // Not pipeline step so @{code build} should be set. if (isLogstashEnabled(build)) { if (build.getAction(LogstashMarkerAction.class) == null)