[verse]
#define *tracelog*('level', 'fmt', ...)
+#define *vtracelog*('level', 'fmt', 'va_list' ap)
Link with `-llttng-ust`.
include::log-levels.txt[]
-To use `tracelog()`, include `<lttng/tracelog.h>` where you need it, and
-link your application with `liblttng-ust`. See the <<example,EXAMPLE>>
-section below for a complete usage example.
+To use `tracelog()` or `vtracelog()`, include `<lttng/tracelog.h>` where you
+need it, and link your application with `liblttng-ust`.
+See the <<example,EXAMPLE>> section below for a complete usage example.
Once your application is instrumented with `tracelog()` calls and
ready to run, use man:lttng-enable-event(1) to enable the
call, use man:tracef(3) instead.
See also the <<limitations,LIMITATIONS>> section below for important
-limitations to consider when using `tracelog()`.
+limitations to consider when using `tracelog()` or `vtracelog()`.
[[example]]
like this:
[role="term"]
----------------------------
-cc -o app app.c -llttng-ust
----------------------------
+----
+$ cc -o app app.c -llttng-ust
+----
You can create an LTTng tracing session, enable all the `tracelog()`
events, and start the created tracing session like this:
[role="term"]
----------------------------------------------------
-lttng create my-session
-lttng enable-event --userspace 'lttng_ust_tracelog:*'
-lttng start
----------------------------------------------------
+----
+$ lttng create my-session
+$ lttng enable-event --userspace 'lttng_ust_tracelog:*'
+$ lttng start
+----
Or you can enable `tracelog()` events matching a log level at least
as severe as a given log level:
[role="term"]
--------------------------------------------------------
-lttng enable-event --userspace 'lttng_ust_tracelog:*' \
+----
+$ lttng enable-event --userspace 'lttng_ust_tracelog:*' \
--loglevel=TRACE_INFO
--------------------------------------------------------
+----
Next, start the program to be traced:
[role="term"]
-------------------------------------------------
-./app a few arguments passed to this application
-------------------------------------------------
+----
+$ ./app a few arguments passed to this application
+----
Finally, stop the tracing session, and inspect the recorded events:
[role="term"]
-----------
-lttng stop
-lttng view
-----------
+----
+$ lttng stop
+$ lttng view
+----
[[limitations]]