GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d37ee165c
debug.c File Reference

GIS Library - Debug functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for debug.c:

Go to the source code of this file.

Functions

void G_init_debug (void)
 Initiate debugging. More...
 
int G_debug (int level, const char *msg,...)
 Print debugging message. More...
 

Detailed Description

GIS Library - Debug functions.

(C) 2001-2012 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
GRASS GIS Development Team

Definition in file debug.c.

Function Documentation

◆ G_debug()

int G_debug ( int  level,
const char *  msg,
  ... 
)

Print debugging message.

Print debugging message if environment variable GRASS_DEBUG_LEVEL is set to level equal or greater

Levels: (recommended levels)

  • 1 - message is printed once or twice per module
  • 2 - less interesting once-per-module messages,
  • 2 - library functions likely to be used once in a module
  • 3 - library functions likely to be called a few times in a module (<=10),
  • 3 - database opening and closing logistics
  • 4 - each row (raster) or line (vector) or database/column (DB),
  • 4 - each column/cat (DB)
  • 5 - each cell (raster) or point (vector) or cat/attribute (DB)
Parameters
[in]levellevel
[in]msgmessage
Returns
0 on error
1 on success

Definition at line 65 of file debug.c.

References G_init_debug().

◆ G_init_debug()

void G_init_debug ( void  )

Initiate debugging.

Definition at line 27 of file debug.c.

References G_is_initialized().

Referenced by G_debug(), and G_init_all().