xref: /aosp_15_r20/external/libtraceevent/Documentation/libtraceevent-log.txt (revision 436bf2bcd5202612ffffe471bbcc1f277cc8d28e)
1libtraceevent(3)
2================
3
4NAME
5----
6tep_set_loglevel - Set log level of the library
7
8SYNOPSIS
9--------
10[verse]
11--
12*#include <event-parse.h>*
13
14enum *tep_loglevel* {
15	TEP_LOG_NONE = 0,
16	TEP_LOG_CRITICAL,
17	TEP_LOG_ERROR,
18	TEP_LOG_WARNING,
19	TEP_LOG_INFO,
20	TEP_LOG_DEBUG,
21	TEP_LOG_ALL
22};
23
24int *tep_set_loglevel*(enum tep_loglevel _level_);
25
26--
27DESCRIPTION
28-----------
29The *tep_set_loglevel()* function sets the level of the library logs that will be printed
30on the console. Library log levels are:
31[verse]
32--
33	_TEP_LOG_NONE_ - Do not print any logs.
34	_TEP_LOG_CRITICAL_ - Print critical logs, problem that may cause a crash.
35	_TEP_LOG_ERROR_ - Print error logs, problem that could break the main logic of an API.
36	_TEP_LOG_WARNING_ - Print warnings, problem that could limit the result of an API.
37	_TEP_LOG_INFO_ - Print information about normal execution of an API.
38	_TEP_LOG_DEBUG_ - Print debug information.
39	_TEP_LOG_ALL_ - Print logs from all levels.
40--
41Setting the log level to specific value means that logs from the previous levels will be printed
42too. For example _TEP_LOG_WARNING_ will print any logs with severity _TEP_LOG_WARNING_,
43_TEP_LOG_ERROR_ and _TEP_LOG_CRITICAL_. The default log level is _TEP_LOG_CRITICAL_.
44
45
46EXAMPLE
47-------
48[source,c]
49--
50#include <event-parse.h>
51
52tep_set_loglevel(TEP_LOG_ALL);
53...
54/* call libtraceevent APIs and observe any logs they produce */
55...
56tep_set_loglevel(TEP_LOG_CRITICAL);
57--
58
59FILES
60-----
61[verse]
62--
63*event-parse.h*
64	Header file to include in order to have access to the library APIs.
65*-ltraceevent*
66	Linker switch to add when building a program that uses the library.
67--
68
69SEE ALSO
70--------
71*libtraceevent*(3), *trace-cmd*(1)
72
73AUTHOR
74------
75[verse]
76--
77*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
78*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
79--
80REPORTING BUGS
81--------------
82Report bugs to  <[email protected]>
83
84LICENSE
85-------
86libtraceevent is Free Software licensed under the GNU LGPL 2.1
87
88RESOURCES
89---------
90https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
91