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

Hamish hamish_nospam at yahoo.com
Thu Nov 9 23:51:44 EST 2006


> > > it seems that the problem is calling G_getl2() function [grass63]
> > > in lib/gis/env.c
> > >
> > > [snip]
> > >
> > > G_getl2() call G_debug() before reading DEBUG value, in the result
> > > static variable grass_debug_level in lib/gis/debug.c is set to 0.
> > >
> >
> > Thank you, Martin!
> >
> > I don't know how to repair G_getl2() properly, but commenting out
> > the G_debug() statement in lib/gis/getl.c (veeeery dirty, I know...)
> > fixes it for the moment...


Ah I see,

the fn that reads .grassrc6 (lib/gis/env.c) is now calling G_getl2(),
and G_getl2() calls G_debug(), which needs a value from .grassrc6.

Do we have to worry about .grassrc6 getting DOS newlines in it?
(user shouldn't be copying that between systems and should not be
editing it)
-> back to using G_getl()

Does G_getl2() really need to call G_debug? I don't think so, the module
that calls it can add G_debug(5, "input line=[]", buff); if they want
that info. 

--> I suggest removing G_debug() from G_getl2() altogether.


Martin's patch fixes this case, but we would need to always audit env.c
and everything it calls, and everything those calls call, to check it
doesn't have any g.gisenv reqs.. :(


Index: lib/gis/getl.c
===================================================================
RCS file: /home/grass/grassrepository/grass6/lib/gis/getl.c,v
retrieving revision 2.4
diff -u -r2.4 getl.c
--- lib/gis/getl.c	9 Feb 2006 03:08:56 -0000	2.4
+++ lib/gis/getl.c	5 Nov 2006 10:18:48 -0000
@@ -82,7 +82,8 @@
     }	
     buf[i] = '\0';
 
-    G_debug ( 4, "G_getl2: ->%s<-", buf );
+    if (G__getenv ("DEBUG"))
+	G_debug ( 4, "G_getl2: ->%s<-", buf );
 
     return ret;
 }



Hamish




More information about the grass-dev mailing list