X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=snprintf%2Fcore.c;h=c017b832220b0230ed2bb9cdeb8eed51fe451286;hb=a60af3a5ee5d990c867ef190acfa81c180301ea2;hp=cbacdb541070c7010f0bec720d34a6ec8220b13b;hpb=7df753215dc4ad6339f8691e45ac72c28f65b0ed;p=lttng-ust.git diff --git a/snprintf/core.c b/snprintf/core.c index cbacdb54..c017b832 100644 --- a/snprintf/core.c +++ b/snprintf/core.c @@ -18,6 +18,24 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#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; + } +}