18 #include <grass/gis.h> 19 #include <grass/glocale.h> 21 static int initialized;
22 static int grass_debug_level;
37 grass_debug_level = atoi(lstr);
39 grass_debug_level = 0;
65 int G_debug(
int level,
const char *msg, ...)
73 if (grass_debug_level >= level) {
76 filen =
getenv(
"GRASS_DEBUG_FILE");
78 fd = fopen(filen,
"a");
80 G_warning(
_(
"Cannot open debug file '%s'"), filen);
88 fprintf(fd,
"D%d/%d: ", level, grass_debug_level);
89 vfprintf(fd, msg, ap);
void G_init_debug(void)
Initiate debugging.
int G_is_initialized(int *p)
void G_initialize_done(int *p)
int G_debug(int level, const char *msg,...)
Print debugging message.
const char * G_getenv_nofatal(const char *name)
Get environment variable.
void G_warning(const char *msg,...)
Print a warning message to stderr.