Skip to content

Avoid using System.out.println instead of log.* #27

Open
@luhenry

Description

@luhenry

Hello,

(First, thank you for this great project!)

As part building Apache Spark (I'm not representing them, just building it on my end), I see some verbose output even when building with mvn --quiet. This is for example because some System.out.println are used (ex: [1]) instead of getLog().info(...).

A sample output is:

Using `mvn` from path: /path/to/spark/build/apache-maven-3.8.6/bin/mvn
Saving to outputFile=/path/to/spark/target/scalastyle-output.xml
Processed 0 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 48 ms
warning: one deprecation
warning: three deprecations (since 2.12.0)
warning: one deprecation (since 2.12.13)
warning: two deprecations (since 2.12.9)
warning: 7 deprecations in total; re-run with -deprecation for details
warning: two feature warnings; re-run with -feature for details
6 warnings found
model contains 12 documentable templates
Saving to outputFile=/path/to/spark/common/tags/target/scalastyle-output.xml
Processed 2 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 167 ms
model contains 9 documentable templates
[...]

I would assume the solution to simply be to replace the System.out.println(...) by getLog().info(...) (with the relevant log level).

If you're happy with the proposed solution, I'm happy to go and submit the corresponding PR.

Thank you!

[1] https://github.com/scalastyle/scalastyle-maven-plugin/blob/master/src/main/java/org/scalastyle/maven/plugin/ScalastyleViolationCheckMojo.java#L248-L259

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions