Logger verbosity not respected
ventsislav-georgiev opened this issue · comments
TL;DR
Small request to use the logger in the main.go
file in order to allow mute of the no refs deleted
messages using the GCRCLEANER_LOG
env var.
ref:
gcr-cleaner/cmd/gcr-cleaner-cli/main.go
Line 186 in ae95cb2
Thank you for opening an issue. The CLI has to output information, and the logger only outputs structured logging (JSON). What is the use case for muting the output?
Hey, thanks for the quick reply.
I'm using the github action as specified here and want to limit the stdout output and print only errors.
The structured logging is really about documenting exchanges with upstream APIs and gcr-cleaner's decision-making process. Errors are printed to stderr, so if you only want errors, you could redirect stdout to /dev/null.
@sethvargo Thanks! I actually didn't realize that the github actions example is running a docker image which just starts the CLI with the provided args. I'm used to the javascript actions and wasn't aware of the docker container ones.
@sethvargo I've just tested it. However, there is no shell in the container and without shell I can't use > /dev/null redirect. I could make a separate container for this use case but.. Any other suggestions?