-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Logging output is sent to stdout instead of stderr when using --stdin #1652
Comments
I expect that sending all log output to stderr will result in other issues for other use cases. In your example it would make sesnse as you ignore all output from stderr as a result of
When issue #1632 is implemented in version 0.48.x you can set the log level to something like "fatal" or "none" which effectively would mean that nothing will be logged. |
References in documentation to stderr should be fixed as since version 0.44 ktlint no longer writes explicitly to |
…with `--log-level=<level>` or the short version `-l=<level>. Closes pinterest#1632 * Allow disabling logging in CLI by setting `--log-level=none` or `-l=none`. Closes pinterest#1652
In ktlint 0.48.0 it seems
As a workaround I'm using a similar grep trick to the above, but if would be nice if we could suppress this and/or log to stderr. |
When using ktlint with --stdin, it's expected that the output of stdout is only the formatted code. Instead, an info logging line is prepended to the stdout with 0.47.1. The pre-commit hook we use (based on https://github.com/hallettj/git-format-staged) relies on the --stdin functionality, and using the latest version the committed files end up with an extra line in the file
Expected Behavior
When called with -F --stdin, only the formatted code should be sent to stdout. Additonal output may be in stderr
Observed Behavior
An INFO level logging line is always output as the first line of stdout
Steps to Reproduce
Outputs
The text was updated successfully, but these errors were encountered: