Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
luhenry opened this issue Feb 9, 2023 · 0 comments
Open

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

luhenry opened this issue Feb 9, 2023 · 0 comments

Comments

@luhenry
Copy link

luhenry commented Feb 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant