[GRASS-dev] making grass modules less verbose

Brad Douglas rez at touchofmadness.com
Thu Sep 21 00:00:11 EDT 2006


On Wed, 2006-09-20 at 21:30 +0100, Glynn Clements wrote:
> Jachym Cepicky wrote:
> 
> > I fully agree with you. But how to do this the best way? Add new
> > parameter to the function? 
> > 
> > e.g.
> > 
> >     G_percent(row,nrows,2,module)
> > 
> >     so that 
> > 
> >     G_percent could call G_percent2(n,d,s,stderr,module->verbose)
> > 
> > Make G_percent(), G_debug() and G_message() read environment variable
> > GRASS_VERBOSE? I would say, this would be the best solution.
> 
> Add a function to query the verbosity level, and change G_percent()
> etc to use it.
> 
> If there's a GRASS_VERBOSE environment variable, you probably want
> both --verbose and --quiet (the latter would disable verbosity even
> when GRASS_VERBOSE is set).

A smaller issue is that of '\n'.  G_message("\n") doesn't work well and
the alternative has been to use:

fprintf(stderr, "\n");

Going quiet may yield an extraneous number of CRs depending on the
module...


-- 
Brad Douglas <rez touchofmadness com>                      KB8UYR
Address: 37.493,-121.924 / WGS84    National Map Corps #TNMC-3785




More information about the grass-dev mailing list