pespin has uploaded this change for review.
core: osmo_init_logging2(): Log talloc output through osmo_logging system
The logging functionality of talloc is mainly used to log warnings and
errors about spotted problems. By default, the logging callback is NULL
and hence nothing is printed. Set up the callback so we can print the
problems spotted.
Change-Id: Ibe85438616d731636579981cce3756922295f48a
---
M src/core/application.c
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/44137/1
diff --git a/src/core/application.c b/src/core/application.c
index bb89adb..e71f4e2 100644
--- a/src/core/application.c
+++ b/src/core/application.c
@@ -78,6 +78,7 @@
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
+#include <talloc.h>
struct log_target *osmo_stderr_target;
@@ -102,6 +103,11 @@
#endif
}
+static void log_talloc_cb(const char *message)
+{
+ LOGP(DLGLOBAL, LOGL_NOTICE, "%s", message);
+}
+
/*! Initialize the osmocom logging framework
* \param[in] log_info Array of available logging sub-systems
* \returns 0 on success, -1 in case of error
@@ -114,6 +120,7 @@
return osmo_init_logging2(NULL, log_info);
}
+
int osmo_init_logging2(void *ctx, const struct log_info *log_info)
{
static int logging_initialized = 0;
@@ -129,6 +136,8 @@
log_add_target(osmo_stderr_target);
log_set_all_filter(osmo_stderr_target, 1);
+
+ talloc_set_log_fn(log_talloc_cb);
return 0;
}
To view, visit change 44137. To unsubscribe, or for help writing mail filters, visit settings.