On Sun, Sep 9, 2018 at 3:47 PM Markus Neteler <[email protected]> wrote: > > Hi, > > Why does G_message() print to stderr and not stdout? > https://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/error.c#L84
Messages, warnings and errors are not output. Consider g.region -g, r.info -g, r.univar -g or any module that produces an output file with default output=- meaning stdout. You don't want any messages in the output if the output is to be automatically parsed later on. Markus M > > This is a big problem when working with grass.run_command() and > friends since Python tends to buffer error messages (or occasionally > eats them). I have no reference why Python does so but there a myriad > of posts from people complaining about it. > > Why an issue? I am currently debugging a long Python script on a > remote system, all docker based, and errors do not really show up. But > especially the grass.message() output is not there so that I can not > easily add debug output. So, the latter I would like to change. > To now add simple print() statements (on stdout) in a GRASS GIS Python > script is a bit against the idea of grass.message()... > Can grass.message() please (optionally) print on stdout? > > Likely I am missing something - suggestions are welcome. > > thanks > Markus > _______________________________________________ > grass-dev mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/grass-dev
_______________________________________________ grass-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-dev
