guarddog icon indicating copy to clipboard operation
guarddog copied to clipboard

Change logging stream to stderr.

Open scovetta opened this issue 1 year ago • 3 comments

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.

scovetta avatar Aug 08 '24 20:08 scovetta

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 avatar Aug 13 '24 12:08 christophetd

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!

scovetta avatar Aug 13 '24 13:08 scovetta

Amazing, really appreciate the contribution!

christophetd avatar Aug 13 '24 13:08 christophetd

This PR is solved by https://github.com/DataDog/guarddog/pull/492

sobregosodd avatar Nov 28 '24 16:11 sobregosodd