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

Change logging stream to stderr. #440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scovetta
Copy link

@scovetta scovetta commented Aug 8, 2024

Logging was set to go to stdout, same as output, which breaks json output.

This change has the logging go to stderr instead.

This should fix #186.

Logging was set to go to stdout, same as output, which breaks json output. This change has the logging go to stderr instead.
@christophetd
Copy link
Contributor

Thanks for the contribution! Makes sense, but it doesn't seem that your implementation is working? I would expect from your change that messaging/human-readable output goes to stderr while stdout is reserved for machine-readable output, but a standard run shows that human-readable output is going to stdout:

$ git branch scovetta/stderr-output
$ python -m guarddog pypi scan requests >stdout 2>stderr
$ cat stderr
$ cat stdout
Found 0 potentially malicious indicators scanning requests

Some rules failed to run while scanning requests:

* repository_integrity_mismatch: failed to run rule repository_integrity_mismatch: Error while cloning repository authentication required but no callback set with github url https://github.com/psf/requests

@christophetd christophetd added the enhancement New feature or request label Aug 13, 2024
@scovetta
Copy link
Author

Ack, sorry, I think I was super tired when I submitted the PR. Let me go back and make sure things look happy and I'll fix the PR. Appreciate the check on your end!

@christophetd
Copy link
Contributor

Amazing, really appreciate the contribution!

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

Successfully merging this pull request may close these issues.

Mysterious errors should be logged to stderr
2 participants