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

fix: send debug output to stderr #467

Merged
merged 1 commit into from
Apr 6, 2023
Merged

fix: send debug output to stderr #467

merged 1 commit into from
Apr 6, 2023

Conversation

apricote
Copy link
Member

@apricote apricote commented Apr 5, 2023

When enabling debug output (HCLOUD_DEBUG=true), this was being printed to stdout by default. If one was using the output of the command in a script, this would break that usage.

By outputting to stderr, we can make sure that the "normal" output still works as expected and can be used in subsequent steps.

For example:

export HCLOUD_DEBUG=true
IP=$(hcloud server ip hccm-dev-1)
ping $IP

When enabling debug output (`HCLOUD_DEBUG=true`), this was being
printed to stdout by default. If one was using the output of the
command in a script, this would break that usage.

By outputting to stderr, we can make sure that the "normal" output
still works as expected and can be used in subsequent steps.

For example:

    export HCLOUD_DEBUG=true
    IP=$(hcloud server ip hccm-dev-1)
    ping $IP
@apricote apricote added the bug label Apr 5, 2023
@apricote apricote requested a review from samcday April 5, 2023 13:04
@apricote apricote self-assigned this Apr 5, 2023
@apricote apricote merged commit ebd67a4 into main Apr 6, 2023
@apricote apricote deleted the debug-logs-stderr branch April 6, 2023 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants