@@ -29,7 +29,7 @@ extern "C" {
#include <odp_std_types.h>
-
+#include <odp_debug.h>
/** @defgroup odp_initialization ODP INITIALIZATION
* Initialisation operations.
@@ -42,6 +42,7 @@ extern "C" {
* level etc.
*/
typedef struct odp_init_t {
+ odp_log_func_t log_fn;
} odp_init_t;
/** ODP platform initialization data.
@@ -15,6 +15,12 @@ int odp_init_global(odp_init_t *params ODP_UNUSED,
{
odp_global_data.log_fn = odp_override_log;
+ if (params != NULL) {
+ if (params->log_fn != NULL)
+ odp_global_data.log_fn = params->log_fn;
+ }
+
+
odp_system_info_init();
if (odp_shm_init_global()) {
Add the ability to pass in a new logging function as a pointer to init_global Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- platform/linux-generic/include/api/odp_init.h | 3 ++- platform/linux-generic/odp_init.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-)