[GRASS-dev] added granularity in GRASS_VERBOSE

Hi,

with the current G_verbose() there is no verbosity level above the
default without getting into debug messages*. (no --very-verbose)

Looking to replace -v verbose flags, there's nowhere to go.

Can we change lib/gis/verbose.c MAXLEVEL to 3? or 5 to match G_debug()
as suggested on the list?

Hamish

* G_debug() is still mostly broken for me in 6.3! (they don't display)

(attachments)

fine_verbose.diff (997 Bytes)

hi,
do i understand it well, that with --verbose also debuging mode would be
started?

so there would be no easy and fast way, how to set verbose level to
STDLEVEL, just via env. variables?

sorry, i do not see any reason, why user should be able to enable
debuging messages with this flag.

my apology, if i understand it wrong

cheers

jachym

On Thu, Oct 26, 2006 at 08:21:47PM +1300, Hamish wrote:

Hi,

with the current G_verbose() there is no verbosity level above the
default without getting into debug messages*. (no --very-verbose)

Looking to replace -v verbose flags, there's nowhere to go.

Can we change lib/gis/verbose.c MAXLEVEL to 3? or 5 to match G_debug()
as suggested on the list?

Hamish

* G_debug() is still mostly broken for me in 6.3! (they don't display)

Index: verbose.c

RCS file: /home/grass/grassrepository/grass6/lib/gis/verbose.c,v
retrieving revision 2.4
diff -u -r2.4 verbose.c
--- verbose.c 10 Oct 2006 09:50:45 -0000 2.4
+++ verbose.c 26 Oct 2006 07:19:47 -0000
@@ -18,7 +18,8 @@
#include <grass/config.h>
#include <stdlib.h>

-#define MAXLEVEL 2
+#define MAXLEVEL 3
+#define STDLEVEL 2
#define MINLEVEL 0

@@ -32,6 +33,8 @@
  * \param 0 - module should print nothing but errors and warnings (G_fatal_error, G_warning)
  * \param 1 - module will print progress information (G_percent)
  * \param 2 - module will print all messages (G_message)
+ * \param 3 - module will be very verbose. Triggered by "--v".
+ * "--v" requires if(G_verbose() == G_verbose_max()) tests.
  */
int G_verbose (void)

@@ -46,7 +49,7 @@
                 ;
         }
         else
- verbose = MAXLEVEL;
+ verbose = STDLEVEL;
     }
     return verbose;
}

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
Department of Geoinformation Technologies
Zemedelska 3
613 00, Brno
Czech Republick
e-mail: xcepicky@node.mendelu.cz
URL: http://mapserver.mendelu.cz
Tel.: +420 545 134 514

Hamish wrote:

> with the current G_verbose() there is no verbosity level above the
> default without getting into debug messages*. (no --very-verbose)
>
> Looking to replace -v verbose flags, there's nowhere to go.
>
> Can we change lib/gis/verbose.c MAXLEVEL to 3? or 5 to match
> G_debug() as suggested on the list?

Jachym Cepicky wrote:

do i understand it well, that with --verbose also debuging mode would
be started?

No, nothing to do with debug messages. I just mentioned that in
reference to rationalizing the debug and verbosity levels, as suggested
earlier on the list (can't find the message now). (min=0, max=5)
I see no real technical need for this many verbosity levels, it's just
to make the controls more consistent & easier to learn.

so there would be no easy and fast way, how to set verbose level to
STDLEVEL, just via env. variables?

export GRASS_VERBOSE=2

sorry, i do not see any reason, why user should be able to enable
debuging messages with this flag.

The problem is in the current setup I find that r.terraflow needs a -v
verbose flag. This is a bit silly as we now have a --verbose flag. But
currently --verbose is no different than without --v. Currently
--verbose only makes the module do something different if you have set
GRASS_VERBOSE=0,1.

By setting MAXVERBOSE to 3, and setting STDVERBOSE to 2, the --verbose
flag will actually make some difference.
Presently STDVERBOSE == MAXVERBOSE.

hope that is clearer,
Hamish