21 static int initialized;
22 static int grass_debug_level;
37 grass_debug_level = atoi(lstr);
39 grass_debug_level = 0;
66 int G_debug(
int level,
const char *msg, ...)
74 if (grass_debug_level >= level) {
75 filen = getenv(
"GRASS_DEBUG_FILE");
77 fd = fopen(filen,
"a");
79 G_warning(
_(
"Cannot open debug file '%s'"), filen);
87 fprintf(fd,
"D%d/%d: ", level, grass_debug_level);
89 vfprintf(fd, msg, ap);
void G_init_debug(void)
Initiate debugging.
int G_debug(int level, const char *msg,...)
Print debugging message.
void G_warning(const char *,...) __attribute__((format(printf
int G_is_initialized(int *)
void G_initialize_done(int *)
const char * G_getenv_nofatal(const char *)
Get environment variable.