domain: add Python domain to list
[lttng-docs.git] / contents / using-lttng / instrumenting / c-application / assigning-log-levels.md
CommitLineData
5e0cbfb0
PP
1---
2id: assigning-log-levels
3---
4
5Optionally, a log level can be assigned to a defined tracepoint.
6Assigning different levels of importance to tracepoints can be useful;
7when controlling tracing sessions,
8[you can choose](#doc-controlling-tracing) to only enable tracepoints
9falling into a specific log level range.
10
11Log levels are assigned to defined tracepoints using the
12`TRACEPOINT_LOGLEVEL()` macro. The latter must be used _after_ having
13used `TRACEPOINT_EVENT()` for a given tracepoint. The
14`TRACEPOINT_LOGLEVEL()` macro has the following construct:
15
16~~~ c
17TRACEPOINT_LOGLEVEL(<provider name>, <tracepoint name>, <log level>)
18~~~
19
20where the first two arguments are the same as the first two arguments
21of `TRACEPOINT_EVENT()` and `<log level>` is one
22of the values given in the
23[LTTng-UST library reference](#doc-liblttng-ust-tracepoint-loglevel)
24section.
25
26As an example, let's assign a `TRACE_DEBUG_UNIT` log level to our
27previous tracepoint definition:
28
29~~~ c
30TRACEPOINT_LOGLEVEL(my_provider, my_tracepoint, TRACE_DEBUG_UNIT)
31~~~
This page took 0.026004 seconds and 4 git commands to generate.