Loading...
Searching...
No Matches
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.
#define | STDLEVEL 2
| Standard verbosity level.
#define | MINLEVEL 0
| Minimum verbosity level (quiet).

## Functions

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

## Detailed Description

GIS Library - Subroutines to manage verbosity level.

Note that verbosity can be controlled by GRASS_VERBOSE environment variable.

See relevant subroutines:

- G_percent()
- G_important_message()
- G_message()
- G_verbose_message()
- G_warning()
- G_fatal_error()

(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(), and G_verbose_max().

## 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.

- -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.

Parameters

  level | new verbosity level (-1,0,1,2,3)

Returns
  0 on invalid verbosity level (verbosity level untouched)
  1 on success

Definition at line 125 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 60 of file verbose.c.

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

Referenced by G_clicker(), G_fatal_error(), G_important_message(), G_init_all(), G_message(), G_parser(), G_percent(), G_progress(), G_verbose_message(), and G_warning().

## G_verbose_max()

int G_verbose_max | ( | void |  | ) |

Get max verbosity level.

Returns
  max verbosity level

Definition at line 81 of file verbose.c.

References MAXLEVEL.

Referenced by G_parser(), and recreate_command().

## G_verbose_min()

int G_verbose_min | ( | void |  | ) |

Get min verbosity level.

Returns
  min verbosity level

Definition at line 101 of file verbose.c.

References MINLEVEL.

Referenced by G_important_message(), and G_parser().

## G_verbose_std()

int G_verbose_std | ( | void |  | ) |

Get standard verbosity level.

Returns
  standard verbosity level

Definition at line 91 of file verbose.c.

References STDLEVEL.

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