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 | ||
9d315d6d | 7 | #include "common/logging.h" |
7df75321 | 8 | |
c6e6343c | 9 | volatile enum lttng_ust_log_level lttng_ust_log_level; |
828c801e | 10 | |
c6e6343c | 11 | void lttng_ust_logging_init(void) |
828c801e | 12 | { |
c6e6343c | 13 | char *lttng_ust_debug; |
828c801e | 14 | |
c6e6343c | 15 | if (lttng_ust_log_level == LTTNG_UST_LOG_LEVEL_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 | */ | |
c6e6343c MJ |
21 | lttng_ust_debug = getenv("LTTNG_UST_DEBUG"); |
22 | if (lttng_ust_debug) | |
23 | lttng_ust_log_level = LTTNG_UST_LOG_LEVEL_DEBUG; | |
828c801e | 24 | else |
c6e6343c | 25 | lttng_ust_log_level = LTTNG_UST_LOG_LEVEL_NORMAL; |
828c801e MD |
26 | } |
27 | } |