1 /* Licensed under LGPLv2.1+ - see LICENSE file for details */
11 #include <ccan/str/str.h>
13 #define DEBUG_NEED_INIT INT_MIN
14 static int debug = DEBUG_NEED_INIT;
16 bool debug_is(int lvl)
18 return lvl <= debug_level();
23 if (debug != DEBUG_NEED_INIT)
25 char *c = getenv("DEBUG");
27 debug = CCAN_PR_LOG_DEFAULT_LEVEL;
35 void pr_log_(char const *fmt, ...)
38 if (fmt[0] == '<' && cisdigit(fmt[1]) && fmt[2] == '>')
46 vfprintf(stderr, fmt, va);