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

influx -import outputs to stderr on success. #8830

Closed
gambrose opened this issue Sep 14, 2017 · 2 comments
Closed

influx -import outputs to stderr on success. #8830

gambrose opened this issue Sep 14, 2017 · 2 comments

Comments

@gambrose
Copy link

gambrose commented Sep 14, 2017

Bug report

System info: influxdb-1.3.5_windows_amd64

Steps to reproduce:

  1. curl https://s3.amazonaws.com/noaa.water-database/NOAA_data.txt -o NOAA_data.txt
  2. influx -import -path=NOAA_data.txt -precision=s -database=NOAA_water_database

Expected behavior: Outputed to stdout

2017/09/14 22:53:20 Processed 1 commands
2017/09/14 22:53:20 Processed 76290 inserts
2017/09/14 22:53:20 Failed 0 inserts

Actual behavior: Outputed to stderr

2017/09/14 22:53:20 Processed 1 commands
2017/09/14 22:53:20 Processed 76290 inserts
2017/09/14 22:53:20 Failed 0 inserts

Additional info:

Logging to stderr makes PowerShell think the command failed when it didn't

influx -import -path NOAA_data.txt -precision s

influx : 2017/09/14 23:05:10 Processed 1 commands
At line:1 char:1
+ influx -import -path NOAA_data.txt -precision s
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (2017/09/14 23:05:10 Processed 1 commands:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
2017/09/14 23:05:10 Processed 76290 inserts
2017/09/14 23:05:10 Failed 0 inserts
@e-dard
Copy link
Contributor

e-dard commented Sep 15, 2017

@gambrose the importer uses Go's standard log.Logger, which by default emits its output to stderr.

I think I agree with you that there should be a better separation there. I'll put up a PR to use stderr and stdout appropriately.

@gambrose
Copy link
Author

Thanks @e-dard looks good to me. 👍

@ghost ghost removed the review label Sep 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants