.gitignore: add some more IDE / tools related file
[babeltrace.git] / src / cli / babeltrace2-log-level.h
CommitLineData
ebddaeb8 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
ebddaeb8 3 *
0235b0db 4 * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
ebddaeb8
SM
5 */
6
ae2be88d
SM
7#ifndef BABELTRACE_CLI_BABELTRACE2_LOG_LEVEL_H
8#define BABELTRACE_CLI_BABELTRACE2_LOG_LEVEL_H
0235b0db 9
ebddaeb8
SM
10#include <babeltrace2/babeltrace.h>
11
12#define ENV_BABELTRACE_CLI_LOG_LEVEL "BABELTRACE_CLI_LOG_LEVEL"
13
14/*
15 * Return the minimal (most verbose) log level between `a` and `b`.
16 *
17 * If one of the parameter has the value -1, it is ignored in the comparison
18 * and the other value is returned. If both parameters are -1, -1 is returned.
19 */
20static inline
21int logging_level_min(int a, int b)
22{
23 if (a == -1) {
24 return b;
25 } else if (b == -1) {
26 return a;
27 } else {
28 return MIN(a, b);
29 }
30}
31
32void set_auto_log_levels(int *logging_level);
33
ae2be88d 34#endif /* BABELTRACE_CLI_BABELTRACE2_LOG_LEVEL_H */
This page took 0.07489 seconds and 5 git commands to generate.