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