Commit | Line | Data |
---|---|---|
7df75321 | 1 | /* |
c0c0989a | 2 | * SPDX-License-Identifier: LGPL-2.1-only |
7df75321 MD |
3 | * |
4 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
7df75321 MD |
5 | */ |
6 | ||
44c72f10 | 7 | #include <usterr-signal-safe.h> |
7df75321 | 8 | |
2b6f4374 | 9 | volatile enum ust_err_loglevel ust_err_loglevel; |
828c801e | 10 | |
2b6f4374 | 11 | void ust_err_init(void) |
828c801e MD |
12 | { |
13 | char *ust_debug; | |
14 | ||
2b6f4374 | 15 | if (ust_err_loglevel == UST_ERR_LOGLEVEL_UNKNOWN) { |
6f626d28 | 16 | /* |
4c41b460 | 17 | * This getenv is not part of lttng_ust_getenv() because it |
6f626d28 MD |
18 | * is required to print ERR() performed during getenv |
19 | * initialization. | |
20 | */ | |
828c801e MD |
21 | ust_debug = getenv("LTTNG_UST_DEBUG"); |
22 | if (ust_debug) | |
2b6f4374 | 23 | ust_err_loglevel = UST_ERR_LOGLEVEL_DEBUG; |
828c801e | 24 | else |
2b6f4374 | 25 | ust_err_loglevel = UST_ERR_LOGLEVEL_NORMAL; |
828c801e MD |
26 | } |
27 | } |