[GRASS-dev] [GRASS-SVN] r53518 - grass/trunk/lib/temporal/lib

Markus Metz markus.metz.giswork at gmail.com
Sun Oct 21 13:11:25 PDT 2012


On Sun, Oct 21, 2012 at 8:10 PM, Martin Landa <landa.martin at gmail.com> wrote:
> Hi,
>
> 2012/10/21 Markus Metz <markus.metz.giswork at gmail.com>:
>
>> All those G_debug(0, ...) instances are most probably leftovers from
>> development of the respective modules/libraries. At least I use
>> sometimes G_debug(0, ...) during development for debugging of
>> particular components because these are always printed. If everything
>> works fine, I change the debug level to something > 0. G_debug(0, ...)
>> does not belong into svn, but is a useful feature during development
>> with your local copy.
>
> probably adding warning message to G_debug() would be meaningful(?) Eg.
>
> Index: lib/gis/debug.c
> ===================================================================
> --- lib/gis/debug.c     (revision 53519)
> +++ lib/gis/debug.c     (working copy)
> @@ -71,6 +71,10 @@
>      G_init_debug();
>
>      if (grass_debug_level >= level) {
> +        if (level < 1 || level > 5)
> +            G_warning(_("Invalid debug level %d. Recommended levels are 1-5."),
> +                      level);
> +
>         va_start(ap, msg);
>
>         filen = getenv("GRASS_DEBUG_FILE");
>

I don't see a reason for this, it's IMHO neither a bugfix nor an
enhancement. G_debug(0, ...) messages will be printed nevertheless,
which is a good thing because (at least for me) it helps debugging new
code before submission. When the new code is tested and ready for
submission, G_debug(0, ...) must be changed by the developer to some
higher level before submission. This is easy enough to catch and fix.

my2c

Markus M


More information about the grass-dev mailing list