[MERGED] osmo-mgw[master]: use osmo_init_logging2() with proper talloc ctx

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Apr 4 16:56:55 UTC 2018


Neels Hofmeyr has submitted this change and it was merged.

Change subject: use osmo_init_logging2() with proper talloc ctx
......................................................................


use osmo_init_logging2() with proper talloc ctx

Change-Id: I3e2a9aef5242efdf11a64536f79099a6e9cec53f
---
M src/osmo-bsc_mgcp/mgcp_main.c
M src/osmo-mgw/mgw_main.c
M tests/legacy_mgcp/mgcp_test.c
M tests/legacy_mgcp/mgcp_transcoding_test.c
M tests/mgcp/mgcp_test.c
M tests/mgcp_client/mgcp_client_test.c
6 files changed, 11 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c
index 91f9074..edb19a6 100644
--- a/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/src/osmo-bsc_mgcp/mgcp_main.c
@@ -244,7 +244,7 @@
 	msgb_talloc_ctx_init(tall_bsc_ctx, 0);
 
 	osmo_init_ignore_signals();
-	osmo_init_logging(&log_info);
+	osmo_init_logging2(tall_bsc_ctx, &log_info);
 
 	cfg = mgcp_config_alloc();
 	if (!cfg)
diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c
index 7762032..de094c1 100644
--- a/src/osmo-mgw/mgw_main.c
+++ b/src/osmo-mgw/mgw_main.c
@@ -262,7 +262,7 @@
 	msgb_talloc_ctx_init(tall_bsc_ctx, 0);
 
 	osmo_init_ignore_signals();
-	osmo_init_logging(&log_info);
+	osmo_init_logging2(tall_bsc_ctx, &log_info);
 
 	cfg = mgcp_config_alloc();
 	if (!cfg)
diff --git a/tests/legacy_mgcp/mgcp_test.c b/tests/legacy_mgcp/mgcp_test.c
index 1a4513e..39400d4 100644
--- a/tests/legacy_mgcp/mgcp_test.c
+++ b/tests/legacy_mgcp/mgcp_test.c
@@ -1214,8 +1214,9 @@
 
 int main(int argc, char **argv)
 {
-	void *msgb_ctx = msgb_talloc_ctx_init(NULL, 0);
-	osmo_init_logging(&log_info);
+	void *ctx = talloc_named_const(NULL, 0, "mgcp_test");
+	void *msgb_ctx = msgb_talloc_ctx_init(ctx, 0);
+	osmo_init_logging2(ctx, &log_info);
 
 	test_strline();
 	test_values();
diff --git a/tests/legacy_mgcp/mgcp_transcoding_test.c b/tests/legacy_mgcp/mgcp_transcoding_test.c
index 61de25f..d3f94c7 100644
--- a/tests/legacy_mgcp/mgcp_transcoding_test.c
+++ b/tests/legacy_mgcp/mgcp_transcoding_test.c
@@ -588,7 +588,8 @@
 int main(int argc, char **argv)
 {
 	int rc;
-	osmo_init_logging(&log_info);
+	void *ctx = talloc_named_const(NULL, 0, "mgcp_transcoding_test");
+	osmo_init_logging2(ctx, &log_info);
 
 	printf("=== Transcoding Good Cases ===\n");
 
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index e1e6290..f6c421a 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1467,8 +1467,9 @@
 
 int main(int argc, char **argv)
 {
-	void *msgb_ctx = msgb_talloc_ctx_init(NULL, 0);
-	osmo_init_logging(&log_info);
+	void *ctx = talloc_named_const(NULL, 0, "mgcp_test");
+	void *msgb_ctx = msgb_talloc_ctx_init(ctx, 0);
+	osmo_init_logging2(ctx, &log_info);
 
 	test_strline();
 	test_values();
diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c
index 19b55e2..007b90c 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -389,7 +389,7 @@
 {
 	ctx = talloc_named_const(NULL, 1, "mgcp_client_test");
 	msgb_talloc_ctx_init(ctx, 0);
-	osmo_init_logging(&log_info);
+	osmo_init_logging2(ctx, &log_info);
 	log_set_print_filename(osmo_stderr_target, 0);
 	log_set_print_timestamp(osmo_stderr_target, 0);
 	log_set_use_color(osmo_stderr_target, 0);

-- 
To view, visit https://gerrit.osmocom.org/7602
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e2a9aef5242efdf11a64536f79099a6e9cec53f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list