[GRASS-dev] do not get debug messages in 63-cvs

Hamish hamish_nospam at yahoo.com
Sat Nov 11 23:18:57 EST 2006


Martin Landa wrote:
> > > > > I am also not sure, is this patch enough to fix it?
> > > > > -    G_debug ( 4, "G_getl2: ->%s<-", buf );
> > > > > +    if (G__getenv ("DEBUG"))
> > > > > +       G_debug ( 4, "G_getl2: ->%s<-", buf );
> > > > >
> > > >
> > > > here, it works ...
> > >
> > > yes, I meant -- when you do not set up DEBUG variable and call
> > > G_getl2() function no debug message (inside the function) will be
> > > printed. It is not nice solution.
> >
> > I would like to kindly ask you -- is it good enough for committing
> > to CVS? [no objections or feedback ~= can be commited;-).
> >
> > Debug messages are still broken in grass63.
> 
> commited to CVS...


Thank you very much for finding and fixing this Martin. After thinking
about it some more I came to the conclusion that G_debug() doesn't
belong in a low-level fn like G_getl2() at all, so I've removed it. It
is the module's choice to spit out a debug message with the result if
wanted. And solving the problem by adding more G_* calls might lead to
the same flavour of bug happening again (in fact G__getenv() calls
read_env() which calls G_getl2() - more circles!).

Also, G_getl2() is used in loops to read huge files, so any chance to
make it simpler (& thus faster) should be taken.


regards,
Hamish




More information about the grass-dev mailing list