In PMD6 all messages to report to a user are reported via a java.util.logging.Logger. In PMD 7, we should probably distinguish two different concerns:
A good log file should be very detailed, including info such as the class emitting the warning. OTOH, a good CLI output would tell the user what's happening without overwhelming them with details. It could have colors for instance. Separating these concerns in the implementation would make it easier to do a better job at each of them (polishing the user interface more, and making log files more detailed).
The rest of this ticket is a RFC about the details. Please feel free to edit, and treat this as a wiki page.
CLI switchesI'd like the default mode to be quiet, and to use a --verbose
switch to show more output. The existing --debug
switch could be used to show logs, to make a bug report. Maybe this should behave like so:
$ pmd -d src -R ruleset/java/quickstart.xml
PMD 7.0.0 - built on 2022-07-14
Processing 50 files...
warning: at src/foo/A.java:20: Cannot find symbol 'org.foo.FooBar'
warning: There were unresolved symbols, please check your --aux-classpath
Nothing to report.
--verbose
:$ pmd -d src -R ruleset/java/quickstart.xml PMD 7.0.0 - built on 2022-07-14 Command line: pmd -d src -R ruleset/java/quickstart.xml Processing 50 files... Processing src/foo/A.java warning: at src/foo/A.java:20: Cannot find symbol 'org.foo.FooBar' 19 | import java.lang.String; 20 | import org.foo.FooBar ^^^^^^^^^^^^^^ Cannot find symbol 'org.foo.FooBar' 21 | import java.lang.String; Processing src/foo/B.java ... warning: There were unresolved symbols, please check your --aux-classpath Nothing to report.
--debug
: Like --verbose
, but also forwards logger output to stdout--verbose --debug
: Same as --debug
, but also enable level TRACE?--debug
to see itRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4