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