[GRASS-dev] making grass modules less verbose
Glynn Clements
glynn at gclements.plus.com
Thu Sep 21 12:58:17 EDT 2006
Brad Douglas 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...
Can you clarify.
G_message() ought to terminate anything it writes.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list