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) {
77 filen = getenv(
"GRASS_DEBUG_FILE");
79 fd = fopen(filen,
"a");
81 G_warning(
_(
"Cannot open debug file '%s'"), filen);
89 fprintf(fd,
"D%d/%d: ", level, grass_debug_level);
90 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.