1LIBTRACEEVENT(3) libtraceevent Manual LIBTRACEEVENT(3)
2
3
4
6 tep_set_loglevel - Set log level of the library
7
9 #include <event-parse.h>
10
11 enum tep_loglevel {
12 TEP_LOG_NONE = 0,
13 TEP_LOG_CRITICAL,
14 TEP_LOG_ERROR,
15 TEP_LOG_WARNING,
16 TEP_LOG_INFO,
17 TEP_LOG_DEBUG,
18 TEP_LOG_ALL
19 };
20
21 int tep_set_loglevel(enum tep_loglevel level);
22
24 The tep_set_loglevel() function sets the level of the library logs that
25 will be printed on the console. Library log levels are:
26
27 TEP_LOG_NONE - Do not print any logs.
28 TEP_LOG_CRITICAL - Print critical logs, problem that may cause a crash.
29 TEP_LOG_ERROR - Print error logs, problem that could break the main logic of an API.
30 TEP_LOG_WARNING - Print warnings, problem that could limit the result of an API.
31 TEP_LOG_INFO - Print information about normal execution of an API.
32 TEP_LOG_DEBUG - Print debug information.
33 TEP_LOG_ALL - Print logs from all levels.
34
35 Setting the log level to specific value means that logs from the
36 previous levels will be printed too. For example TEP_LOG_WARNING will
37 print any logs with severity TEP_LOG_WARNING, TEP_LOG_ERROR and
38 TEP_LOG_CRITICAL. The default log level is TEP_LOG_CRITICAL.
39
41 #include <event-parse.h>
42
43 tep_set_loglevel(TEP_LOG_ALL);
44 ...
45 /* call libtraceevent APIs and observe any logs they produce */
46 ...
47 tep_set_loglevel(TEP_LOG_CRITICAL);
48
50 event-parse.h
51 Header file to include in order to have access to the library APIs.
52 -ltraceevent
53 Linker switch to add when building a program that uses the library.
54
56 libtraceevent(3), trace-cmd(1)
57
59 Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent.
60 Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page.
61
63 Report bugs to <linux-trace-devel@vger.kernel.org[3]>
64
66 libtraceevent is Free Software licensed under the GNU LGPL 2.1
67
69 https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
70
72 1. rostedt@goodmis.org
73 mailto:rostedt@goodmis.org
74
75 2. tz.stoyanov@gmail.com
76 mailto:tz.stoyanov@gmail.com
77
78 3. linux-trace-devel@vger.kernel.org
79 mailto:linux-trace-devel@vger.kernel.org
80
81
82
83libtraceevent 1.7.2 04/05/2023 LIBTRACEEVENT(3)