6 The `tracelog()` API is very similar to [`tracef()`](#doc-tracef). The
7 only difference is that it accepts an additional log level parameter.
9 The goal of `tracelog()` is to ease the migration from logging to
15 #include <lttng/tracelog.h>
17 void my_function(int my_integer) {
20 tracelog(TRACE_INFO, "my message, my integer: %d", my_integer);
26 See [LTTng-UST library reference](#doc-liblttng-ust-tracepoint-loglevel)
27 for the list of available log level names.
29 Link your application with `liblttng-ust`:
32 gcc -o app app.c <strong>-llttng-ust</strong>
35 Execute the application as usual:
41 The events produced by `tracelog()` calls are prefixed with
42 `lttng_ust_tracelog:`. To enable `tracelog()` events matching a range
46 lttng enable-event --userspace 'lttng_ust_tracelog:*' \
50 This enables all `tracelog()` events with a log level at least as important
53 To enable `tracelog()` events matching a specific log level, do:
56 lttng enable-event --userspace 'lttng_ust_tracelog:*' \
57 --loglevel-only TRACE_WARNING
60 See [Enabling and disabling events](#doc-enabling-disabling-events) for