use osmo_init_logging2() with proper talloc ctx

Change-Id: I3e2a9aef5242efdf11a64536f79099a6e9cec53f
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);