maven-checkstyle-plugin icon indicating copy to clipboard operation
maven-checkstyle-plugin copied to clipboard

[MCHECKSTYLE-408] - Ensure Checkstyle console logs are properly formatted

Open JackPGreen opened this issue 4 months ago • 0 comments

When the check goal is run, the following is output:

[INFO] --- checkstyle:check (default-cli) @ project ---
[INFO] Starting audit...
Audit done.

At first glance, it appears as the Audit done message is not from a logger, and this was how the issue was described in MCHECKSTYLE-408.

Further investigation shows that actually, all logging events are written to stringOutputStream, resulting in this:

Starting audit... Audit done.

And at the end, this is logged as a single, multi-line log message.

Changes:

  • Replace stringOutputStream/defaultLogger with a new data structure (CheckstyleExecutorRequest)
  • Log the messages as they are produced, rather than in a batch at the end

New output:

[INFO] --- checkstyle:check (default-cli) @ project ---
[INFO] Starting audit...
[INFO] Audit done.

JackPGreen avatar Oct 28 '24 13:10 JackPGreen