GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
verbose.c File Reference

GIS Library - Subroutines to manage verbosity level. More...

#include <stdlib.h>
#include <grass/config.h>
#include <grass/gis.h>
Include dependency graph for verbose.c:

Go to the source code of this file.

Macros

#define MAXLEVEL   3
 Maximum verbosity level. More...
 
#define STDLEVEL   2
 Standard verbosity level. More...
 
#define MINLEVEL   0
 Minimum verbosity level (quiet) More...
 

Functions

int G_verbose (void)
 Get current verbosity level. More...
 
int G_verbose_max (void)
 Get max verbosity level. More...
 
int G_verbose_std (void)
 Get standard verbosity level. More...
 
int G_verbose_min (void)
 Get min verbosity level. More...
 
int G_set_verbose (int level)
 Set verbosity level. More...
 

Detailed Description

GIS Library - Subroutines to manage verbosity level.

Note that verbosity can be controlled by GRASS_VERBOSE environment variable.

See relevant subroutines:

(C) 2001-2008, 2012-2013 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Jachym Cepicky - jachym.cepicky at gmail.com

Definition in file verbose.c.

Macro Definition Documentation

◆ MAXLEVEL

#define MAXLEVEL   3

Maximum verbosity level.

Definition at line 30 of file verbose.c.

Referenced by G_set_verbose(), G_verbose_max(), RTreeCreateTree(), RTreeDestroyTree(), RTreeInsertRectF(), and RTreeInsertRectM().

◆ MINLEVEL

#define MINLEVEL   0

Minimum verbosity level (quiet)

Definition at line 34 of file verbose.c.

Referenced by G_set_verbose(), and G_verbose_min().

◆ STDLEVEL

#define STDLEVEL   2

Standard verbosity level.

Definition at line 32 of file verbose.c.

Referenced by G_verbose(), and G_verbose_std().

Function Documentation

◆ G_set_verbose()

int G_set_verbose ( int  level)

Set verbosity level.

Parameters
levelnew verbosity level (-1,0,1,2,3)
Returns
0 on invalid verbosity level (verbosity level untouched)
1 on success

Definition at line 116 of file verbose.c.

References G_initialize_done(), G_is_initialized(), MAXLEVEL, and MINLEVEL.

◆ G_verbose()

int G_verbose ( void  )

Get current verbosity level.

Currently, there are 5 levels of verbosity (see return codes)

Returns
-1 - nothing will be printed (also errors and warnings will be also discarded)
0 - nothing will be printed except of errors and warnings (G_fatal_error(), G_warning()). Triggered by –q or –quiet flag..
1 - only progress information (G_percent()) and important messages (G_important_message()) will be printed
2 - all messages (G_message() and G_important_message()) will be printed
3 - also verbose messages (G_verbose_message()) will be printed. Triggered by –v or –verbose flag.

Definition at line 55 of file verbose.c.

References G_initialize_done(), G_is_initialized(), getenv(), and STDLEVEL.

Referenced by G_fatal_error(), G_important_message(), G_init_all(), G_message(), and G_verbose_message().

◆ G_verbose_max()

int G_verbose_max ( void  )

Get max verbosity level.

Returns
max verbosity level

Definition at line 76 of file verbose.c.

References MAXLEVEL.

◆ G_verbose_min()

int G_verbose_min ( void  )

Get min verbosity level.

Returns
min verbosity level

Definition at line 96 of file verbose.c.

References MINLEVEL.

Referenced by G_important_message().

◆ G_verbose_std()

int G_verbose_std ( void  )

Get standard verbosity level.

Returns
standard verbosity level

Definition at line 86 of file verbose.c.

References STDLEVEL.

Referenced by G_message(), G_parser(), and G_verbose_message().