LIBTRACEEVENT(3)

πŸ’– LIBTRACEEVENT(3) β€” the libtraceevent manual, bestie edition πŸ’–

okay so welcome to the libtraceevent manual page, we're doing this, grab a snack πŸ“


✨ NAME ✨

tep_set_loglevel β€” set the log level of the library, that's it, that's the whole job πŸ’…


✨ SYNOPSIS ✨

#include <event-parse.h>

enum tep_loglevel {
        TEP_LOG_NONE = 0,
        TEP_LOG_CRITICAL,
        TEP_LOG_ERROR,
        TEP_LOG_WARNING,
        TEP_LOG_INFO,
        TEP_LOG_DEBUG,
        TEP_LOG_ALL
};

int tep_set_loglevel(enum tep_loglevel level);

like yes, that's an enum and a function, we love a tidy header 🫢


✨ DESCRIPTION ✨

so tep_set_loglevel() sets the level of the library logs that get printed on the console. it's giving volume knob for library drama πŸ”₯

the library log levels are, from quietest to loudest:

  • TEP_LOG_NONE β€” don't print ANY logs. zero. silence. 🀫
  • TEP_LOG_CRITICAL β€” print critical logs, aka the problems that may cause a crash 😭
  • TEP_LOG_ERROR β€” print error logs, aka problems that could break the main logic of an API πŸ’€
  • TEP_LOG_WARNING β€” print warnings, aka problems that could limit the result of an API πŸ™ˆ
  • TEP_LOG_INFO β€” print information about normal execution of an API ✨
  • TEP_LOG_DEBUG β€” print debug information 🧚
  • TEP_LOG_ALL β€” print logs from all levels. chaotic, unhinged, iconic πŸ‘‘

and here's the key lore: setting the log level to a specific value means logs from the previous levels get printed too. so for example TEP_LOG_WARNING will print any logs with severity TEP_LOG_WARNING, TEP_LOG_ERROR and TEP_LOG_CRITICAL. it's cumulative, no cap πŸŽ€

default log level is TEP_LOG_CRITICAL β€” so by default you only hear about the crash-y stuff.

✨ EXAMPLE ✨

the way to do it, fr fr:

#include <event-parse.h>

tep_set_loglevel(TEP_LOG_ALL);
...
/* call libtraceevent APIs and observe any logs they produce */
...
tep_set_loglevel(TEP_LOG_CRITICAL);

turn it all the way up, do the thing, turn it back down. main character energy 🌈


✨ FILES ✨

  • event-parse.h β€” header file to include in order to have access to the library APIs. the ✨ entry point ✨
  • -ltraceevent β€” linker switch to add when building a program that uses the library. don't forget her 🫢

✨ SEE ALSO ✨

libtraceevent(3), trace-cmd(1)

iykyk, go read those too πŸ“š


✨ AUTHOR ✨

  • Steven Rostedt <rostedt@goodmis.org> β€” author of libtraceevent πŸ‘‘
  • Tzvetomir Stoyanov <tz.stoyanov@gmail.com> β€” author of this man page, the blueprint πŸ’œ

✨ REPORTING BUGS ✨

found a bug? spill it to <linux-trace-devel@vger.kernel.org> πŸ›


✨ LICENSE ✨

libtraceevent is Free Software licensed under the GNU LGPL 2.1 β€” periodt πŸ’…


✨ RESOURCES ✨

https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/


✨ NOTES ✨

  1. rostedt@goodmis.org β€” mailto:rostedt@goodmis.org
  2. tz.stoyanov@gmail.com β€” mailto:tz.stoyanov@gmail.com
  3. linux-trace-devel@vger.kernel.org β€” mailto:linux-trace-devel@vger.kernel.org

and that's the whole page bestie πŸ¦‹ this was libtraceevent version 1.9.0, dated 06/15/2026, no cap. go set your log level and slay πŸ’–πŸŒΈ

πŸ“¦ where this page comes from