gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Progress messages should go to stderr, not stdout

Open jidanni opened this issue 2 years ago • 5 comments

gdal2xyz.py has no way to turn off progress messages. it needs a "-q Suppress progress monitor and other non-error output." like gdal_create.

Also progress messages should go to stderr, not stdout! Same with gdal_grid.

jidanni avatar Sep 24 '23 12:09 jidanni

I am not a programmer but gdal2xyz.py is Python so maybe it cannot be directly compared with gdal_create. About stderr/stdout I can say nothing.

jratike80 avatar Sep 24 '23 12:09 jratike80

Also progress messages should go to stderr, not stdout!

this is quite disputed in https://unix.stackexchange.com/questions/331611/do-progress-reports-logging-information-belong-on-stderr-or-stdout . I'm not sure all GDAL utilities are consistent regarding this, but for now I wouldn't change that

rouault avatar Sep 24 '23 13:09 rouault

Well okay... will just need elaborate filters to clean the progress messages out of standard output when piping to other programs.

jidanni avatar Sep 24 '23 23:09 jidanni

will just need elaborate filters to clean the progress messages out of standard output when piping to other programs.

hum, good point. Most GDAL programs have not both an interesting standard output that can be piped and a progress bar, but I see that "gdal2xyz.py input.tif /vsistdout/". But in that situation, a -q option is probably better indeed

rouault avatar Sep 25 '23 00:09 rouault

Yes. And about stdout vs. stderr, trust me, that's how K&R would do it.

jidanni avatar Sep 25 '23 09:09 jidanni