X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=snprintf%2Fcore.c;h=c017b832220b0230ed2bb9cdeb8eed51fe451286;hb=6f626d284c2bb02ae8980da6e8053e191d604286;hp=2fa9839c4e4103c40635cfd8181418b9bf158ccf;hpb=44c72f10aa3cace72ffe40a0f9bb7aadb9c82dc8;p=lttng-ust.git diff --git a/snprintf/core.c b/snprintf/core.c index 2fa9839c..c017b832 100644 --- a/snprintf/core.c +++ b/snprintf/core.c @@ -21,3 +21,21 @@ #include volatile enum ust_loglevel ust_loglevel; + +void init_usterr(void) +{ + char *ust_debug; + + if (ust_loglevel == UST_LOGLEVEL_UNKNOWN) { + /* + * This getenv is not part of lttng_getenv() because it + * is required to print ERR() performed during getenv + * initialization. + */ + ust_debug = getenv("LTTNG_UST_DEBUG"); + if (ust_debug) + ust_loglevel = UST_LOGLEVEL_DEBUG; + else + ust_loglevel = UST_LOGLEVEL_NORMAL; + } +}