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

geoipupdate output written to stderr instead of stdout #271

Open
dinodipardo opened this issue Dec 18, 2023 · 4 comments
Open

geoipupdate output written to stderr instead of stdout #271

dinodipardo opened this issue Dec 18, 2023 · 4 comments

Comments

@dinodipardo
Copy link

All geoipupdate output is written to stderr instead of stdout, even on success:

{ { geoipupdate --version; } 2>&3 | sed 's/^/STDOUT: /'; } 3>&1 1>&2 | sed 's/^/STDERR: /'
{ { geoipupdate -h; } 2>&3 | sed 's/^/STDOUT: /'; } 3>&1 1>&2 | sed 's/^/STDERR: /'

@horgh
Copy link
Contributor

horgh commented Dec 18, 2023

Yeah, I agree this is kind of odd, although I'm not sure it is technically wrong. It is a result of using Go's default logger. I'm not sure we'd want to change it at this point. #119 is related.

@dinodipardo
Copy link
Author

Technically I think nothing is wrong. But from an automation perspective this doesn't make sense. If lasterror is 0 the version should be printed to stdout. Currently hard to process output in scripts since you need to capture both stdin and stderr to see if any output is generated independent on the error code

@horgh
Copy link
Contributor

horgh commented Dec 18, 2023

Are you wanting to run --version automatically? We don't print any output unless it's an error (with non exit status 0) when run normally I believe.

@dinodipardo
Copy link
Author

Using --version to detect if an new version should be installed

using it in PowerShell code
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants