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

Allow logging even when printing to stdout #79

Merged
merged 2 commits into from
Aug 2, 2021
Merged

Allow logging even when printing to stdout #79

merged 2 commits into from
Aug 2, 2021

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Aug 2, 2021

Related Issue(s): n/a

Description: I found it surprising when --logging DEBUG didn't change anything, but then discovered that logging is silently disabled if the cli is printing to stdout. This PR enables logging in all cases, printing to stderr if data are being printed to stdout. This enables logging+piping, e.g.

stac-client search .. --logging DEBUG > out.json

PR Checklist:

  • Code is formatted
  • Tests pass
  • Changes are added to the CHANGELOG

I found it surprising when `--logging DEBUG` didn't change anything, but
then discovered that logging is silently disabled if the cli is printing
to stdout. This PR enables logging in all cases, printing to stderr if
data are being printed to stdout. This enables logging+piping, e.g.

> stac-client search .. --logging DEBUG > out.json
@matthewhanson matthewhanson merged commit 02bad72 into stac-utils:main Aug 2, 2021
@gadomski gadomski deleted the feature/logging-to-stderr branch August 3, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants