Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
|
Logging level enumerators and library logging control.
The logging API offers logging level enumerators (bt_logging_level) as well as functions to control libbabeltrace2's internal logging.
libbabeltrace2 contains many hundreds of logging statements to help you follow and debug your plugin or program.
The LIBBABELTRACE2_INIT_LOG_LEVEL
environment variable controls the initial logging level of the library. If this environment variable isn't set at library load time, then the initial logging level of the library is BT_LOGGING_LEVEL_NONE. See Logging to learn more.
Set libbabeltrace2's current logging level with bt_logging_set_global_level().
bt_logging_set_global_level() only controls libbabeltrace2's logging level; it does not control the logging level of:
As of Babeltrace 2.0, there's no module-specific logging level control: bt_logging_set_global_level() sets the logging level of all the modules of the library.
libbabeltrace2 writes its logging statements to the standard error stream. A logging line looks like this:
See Logging to learn more about the format of a logging statement line.
You can set a minimal logging level at the Babeltrace 2 project build time (see Logging to learn how). The logging statements with a level that's less severe than the minimal logging level are not built. For example, if the minimal logging level is BT_LOGGING_LEVEL_INFO, then the BT_LOGGING_LEVEL_TRACE and BT_LOGGING_LEVEL_DEBUG logging statements aren't built. Use bt_logging_get_minimal_level() to get the minimal logging level of the library.
Typedefs | |
typedef enum bt_logging_level | bt_logging_level |
Logging level enumerators. | |
Enumerations | |
enum | bt_logging_level { BT_LOGGING_LEVEL_TRACE , BT_LOGGING_LEVEL_DEBUG , BT_LOGGING_LEVEL_INFO , BT_LOGGING_LEVEL_WARNING , BT_LOGGING_LEVEL_ERROR , BT_LOGGING_LEVEL_FATAL , BT_LOGGING_LEVEL_NONE } |
Logging level enumerators. More... | |
Functions | |
void | bt_logging_set_global_level (bt_logging_level logging_level) |
Sets the logging level of all the libbabeltrace2 modules to logging_level. | |
bt_logging_level | bt_logging_get_global_level (void) |
Returns the current logging level of all the libbabeltrace2 modules. | |
bt_logging_level | bt_logging_get_minimal_level (void) |
Returns the minimal (build-time) logging level of the library. | |
enum bt_logging_level |
Logging level enumerators.
|
extern |
Sets the logging level of all the libbabeltrace2 modules to logging_level.
The global logging level of the library doesn't affect the logging level of individual components and query operations.
[in] | logging_level | New global logging level of the library. |
|
extern |
Returns the current logging level of all the libbabeltrace2 modules.
|
extern |
Returns the minimal (build-time) logging level of the library.
The library logging statements with a level that's less severe than the minimal logging level are not built.
For example, if the minimal logging level is BT_LOGGING_LEVEL_INFO, then the BT_LOGGING_LEVEL_TRACE and BT_LOGGING_LEVEL_DEBUG logging statements aren't built.