B1NARY-GR0UP / nwa

A More Powerful License Header Management Tool
Apache License 2.0
7 stars 2 forks source link

Improve displaying check results #8

Open clemlatz opened 1 week ago

clemlatz commented 1 week ago

Is your feature request related to a problem? Please describe.

When using nwa command check a lot of file, it can be hard to see what files miss a header because of all the success ("matched header") logs. The last line only show the number of mismatched file but you then need to scroll the results to file all mismatched file.

Capture d’écran 2024-11-12 à 08 37 13

Describe the solution you'd like

Either clearly display a list of files that needs attention at the end, or even better, add an option to display verbose logs with success logs, which I believe should be disabled by default, to only show files that needs attention (although that might be a breaking change).

Describe alternatives you've considered

Using grep to filter results. This works fine but is hard to use in a CI environment. I believe this should be native to nwa.

Capture d’écran 2024-11-12 à 08 43 39

Additional context

At first, I thought this wasn't necessary because, when check would find files without header, I wouldn't need to know which files exactly and I would just run add on all of them. But in a CI environnement, it can be a useful information to show in the error log.

justlorain commented 1 week ago

This is a very good proposal and also quite feasible to implement.

Do you have any suggestions for a name for this option, such as --fulllog (-f)?

clemlatz commented 1 week ago

Great!

An argument I often see for this is --verbose or -V to log everything, while the default behavior only logs errors.

justlorain commented 18 hours ago

Hi!

The verbose flag is now supported in the latest v0.4.0 release. You can enable it using --verbose or -V.

Without verbose mode enabled, NWA will not output logs below the WARN level (e.g. information about successful operations).

And the logs related to failed operations (e.g. mismatched) have been changed to WARN level or above.