X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=CONTRIBUTING.adoc;h=32fd796343b5b669aadf69ca9bd37686cd1f89f4;hb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1;hp=bc6ff471ec403e22e6f2e1698ed35211eedee2f2;hpb=56e18c4ce186892c36d7f2cb5078087425e60134;p=babeltrace.git diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index bc6ff471..32fd7963 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -225,7 +225,7 @@ image::doc/contributing-images/bt-ref13.png[] == Valgrind To use Valgrind on an application (for example, the CLI or a test) which -loads libbabeltrace, use: +loads libbabeltrace2, use: $ G_SLICE=always-malloc G_DEBUG=gc-friendly PYTHONMALLOC=malloc \ BABELTRACE_NO_DLCLOSE=1 valgrind --leak-check=full \ @@ -236,7 +236,7 @@ loads libbabeltrace, use: the Python plugin provider (Valgrind will probably show a lot of errors which originate from Python interpreter anyway). -`BABELTRACE_NO_DLCLOSE=1` makes libbabeltrace not close the shared +`BABELTRACE_NO_DLCLOSE=1` makes libbabeltrace2 not close the shared libraries (plugins) which it loads. This is needed to see the appropriate backtrace when Valgrind shows errors. @@ -280,22 +280,22 @@ library (`logging` directory). The logging API headers are: -``:: +``:: Public header which a library user can use to control and read - libbabeltrace's current log level. + libbabeltrace2's current log level. -``:: +``:: Internal, generic logging API which you can use in any Babeltrace subproject. This is the translation of `zf_log.h`. -``:: +``:: Specific internal header to use within the library. This header defines `BT_LOG_OUTPUT_LEVEL` to a custom, library-wide hidden symbol which is the library's current log level before including - ``. + ``. -Do not include `` or -`` in a header which contains logging +Do not include `` or +`` in a header which contains logging statements: this header could be included in source files which define a different <>, for example. See <>. @@ -355,14 +355,14 @@ get the configured minimal log level. `_bt_log_global_output_lvl` symbol. In practice, we never use this symbol, and always make sure that `BT_LOG_OUTPUT_LEVEL` is defined to a module-wise or subproject-wise hidden symbol before including -``. In the library, -`` does this job: just include this +``. In the library, +`` does this job: just include this header which defines `BT_LOG_OUTPUT_LEVEL` to the appropriate symbol -before it includes ``. In plugins, for +before it includes ``. In plugins, for example, there is one log level per component class, which makes log filtering easier during execution. + -In libbabeltrace, the user can set the current run-time log level with +In libbabeltrace2, the user can set the current run-time log level with the `bt_logging_set_global_level()` function, for example: + -- @@ -593,7 +593,7 @@ Follow those steps to make your module loggable: */ #define BT_LOG_OUTPUT_LEVEL my_module_log_level -#include +#include BT_LOG_INIT_LOG_LEVEL(my_module_log_level, "BABELTRACE_MY_MODULE_LOG_LEVEL"); ---- @@ -639,7 +639,7 @@ the environment variable and sets the log level symbol accordingly. */ #define BT_LOG_OUTPUT_LEVEL my_module_log_level -#include +#include BT_LOG_LEVEL_EXTERN_SYMBOL(my_module_log_level); @@ -654,7 +654,7 @@ log level symbol. of your module's object in your module's root `Makefile.am`. . Add the log level initializing environment variable name to the - `log_level_env_var_names` array in `cli/babeltrace.c`. + `log_level_env_var_names` array in `cli/babeltrace2.c`. [[logging-instrument-source]]