Change in osmo-bsc[master]: ipaccess-config: Use stderr for debug type messages

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Nov 8 13:43:21 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/11687


Change subject: ipaccess-config: Use stderr for debug type messages
......................................................................

ipaccess-config: Use stderr for debug type messages

This way we want print only a formated output in stdout when using -G.

Related: OS#3624
Change-Id: I257bfc8d82b49a3641be6b6777e472ecf561a21e
---
M src/ipaccess/ipaccess-config.c
1 file changed, 12 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/87/11687/1

diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index 93b934b..3de68aa 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -545,7 +545,7 @@
 	int need_to_set_attr = 0;
 	int len;
 
-	printf("OML link established using TRX %d\n", trx->nr);
+	fprintf(stderr, "OML link established using TRX %d\n", trx->nr);
 
 	if (get_attr) {
 		msgb_put_u8(nmsg_get, NM_ATT_IPACC_PRIM_OML_CFG);
@@ -555,7 +555,7 @@
 		len = strlen(unit_id);
 		if (len > nmsg_set->data_len-10)
 			goto out_err;
-		printf("setting Unit ID to '%s'\n", unit_id);
+		fprintf(stderr, "setting Unit ID to '%s'\n", unit_id);
 		nv_put_unit_id(nmsg_set, unit_id);
 		need_to_set_attr = 1;
 	}
@@ -568,12 +568,12 @@
 			goto out_err;
 		}
 
-		printf("setting primary OML link IP to '%s'\n", inet_ntoa(ia));
+		fprintf(stderr, "setting primary OML link IP to '%s'\n", inet_ntoa(ia));
 		nv_put_prim_oml(nmsg_set, ntohl(ia.s_addr), 0);
 		need_to_set_attr = 1;
 	}
 	if (nv_mask) {
-		printf("setting NV Flags/Mask to 0x%04x/0x%04x\n",
+		fprintf(stderr, "setting NV Flags/Mask to 0x%04x/0x%04x\n",
 			nv_flags, nv_mask);
 		nv_put_flags(nmsg_set, nv_flags, nv_mask);
 		need_to_set_attr = 1;
@@ -593,7 +593,7 @@
 			goto out_err;
 		}
 
-		printf("setting static IP Address/Mask\n");
+		fprintf(stderr, "setting static IP Address/Mask\n");
 		nv_put_ip_if_cfg(nmsg_set, ntohl(ia_addr.s_addr), ntohl(ia_mask.s_addr));
 		need_to_set_attr = 1;
 	}
@@ -606,7 +606,7 @@
 			goto out_err;
 		}
 
-		printf("setting static IP Gateway\n");
+		fprintf(stderr, "setting static IP Gateway\n");
 		/* we only set the default gateway with zero addr/mask */
 		nv_put_gw_cfg(nmsg_set, 0, 0, ntohl(ia_gw.s_addr));
 		need_to_set_attr = 1;
@@ -619,13 +619,13 @@
 	}
 
 	if (need_to_set_attr) {
-		printf("abis_nm_ipaccess_set_nvattr\n");
+		fprintf(stderr, "abis_nm_ipaccess_set_nvattr\n");
 		abis_nm_ipaccess_set_nvattr(trx, nmsg_set->head, nmsg_set->len);
 		oml_state = 1;
 	}
 
 	if (restart && !prim_oml_ip && !software) {
-		printf("restarting BTS\n");
+		fprintf(stderr, "restarting BTS\n");
 		abis_nm_ipaccess_restart(trx);
 	}
 
@@ -654,7 +654,7 @@
 					    phys_conf_min, sizeof(phys_conf_min));
 		else if (software) {
 			int rc;
-			printf("Attempting software upload with '%s'\n", software);
+			fprintf(stderr, "Attempting software upload with '%s'\n", software);
 			rc = abis_nm_software_load(trx->bts, trx->nr, software, 19, 0, swload_cbfn, trx);
 			if (rc < 0) {
 				fprintf(stderr, "Failed to start software load\n");
@@ -963,8 +963,8 @@
 	osmo_init_logging2(tall_ctx_config, &log_info);
 	bts_model_nanobts_init();
 
-	printf("ipaccess-config (C) 2009-2010 by Harald Welte and others\n");
-	printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n");
+	fprintf(stderr, "ipaccess-config (C) 2009-2010 by Harald Welte and others\n");
+	fprintf(stderr, "This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n");
 
 	while (1) {
 		int c;
@@ -1115,7 +1115,7 @@
 
 	ipac_nwl_init();
 
-	printf("Trying to connect to ip.access BTS %s...\n", bts_ip);
+	fprintf(stderr, "Trying to connect to ip.access BTS %s...\n", bts_ip);
 
 	memset(&sin, 0, sizeof(sin));
 	sin.sin_family = AF_INET;

-- 
To view, visit https://gerrit.osmocom.org/11687
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I257bfc8d82b49a3641be6b6777e472ecf561a21e
Gerrit-Change-Number: 11687
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181108/953c0fd6/attachment.html>


More information about the gerrit-log mailing list