<div dir="ltr"><br><br>On Sun, Sep 9, 2018 at 4:46 PM Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>><br>> On Sun, Sep 9, 2018 at 4:23 PM Markus Metz<br>> <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> wrote:<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>> ><br>> > 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.<br>><br>> OK, I see.<br><div>> So, for output like "Step X: processing ...:" I need to use print()?</div><div><br></div><div>this is going to stdout<br></div>><br>> My preferred way would be grass.debug() because then I would later<br>> switch these message to level 1 in order to "hide" them. Yet, I think<br><div>> that they disappear...</div><div><br></div><div>if stderr disappears, they disappear</div><div><br></div><div>the question is, what happens with stderr in Python? Where is it? Is it recoverable? See also your other post.<br></div>><br>> I'd also like to see a way to print through the parser, i.e. a<br>> functionality similiar to "sh -x shellscript" which prints every step.<br><div>> Is that possible?</div><div><br></div><div>In Python you mean? Maybe one of the GRASS Python gurus can answer that (not me).<br></div><br>Markus M<br></div>