Change in osmocom-bb[master]: mobile/app_mobile.c: use LOGP() instead of printf()/fprintf()

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Nov 21 03:44:13 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/11850


Change subject: mobile/app_mobile.c: use LOGP() instead of printf()/fprintf()
......................................................................

mobile/app_mobile.c: use LOGP() instead of printf()/fprintf()

Change-Id: I6af76afbaa34dde5ddfc31a65700030862442dba
---
M src/host/layer23/src/mobile/app_mobile.c
1 file changed, 8 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/50/11850/1

diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index af627c6..464cd55 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -452,20 +452,19 @@
 	if (config_file != NULL) {
 		rc = vty_read_config_file(config_file, &dummy_conn);
 		if (rc < 0) {
-			fprintf(stderr, "Failed to parse the config file:"
-					" '%s'\n", config_file);
-			fprintf(stderr, "Please check or create config file"
-					" using: 'touch %s'\n", config_file);
-			fprintf(stderr, "or use one from "
-					"'doc/examples/mobile/'\n");
+			LOGP(DMOB, LOGL_FATAL, "Failed to parse the configuration "
+				"file '%s'\n", config_file);
+			LOGP(DMOB, LOGL_FATAL, "Please make sure the file "
+				"'%s' exists, or use an example from "
+				"'doc/examples/mobile/'\n", config_file);
 			return rc;
 		}
-		printf("Using configuration from %s\n", config_file);
+		LOGP(DMOB, LOGL_INFO, "Using configuration from '%s'\n", config_file);
 	}
 	vty_reading = 0;
 	rc = telnet_init_dynif(l23_ctx, NULL, vty_ip, vty_port);
 	if (rc < 0) {
-		fprintf(stderr, "Cannot init VTY on %s port %u: %s\n",
+		LOGP(DMOB, LOGL_FATAL, "Cannot init VTY on %s port %u: %s\n",
 			vty_ip, vty_port, strerror(errno));
 		return rc;
 	}
@@ -477,7 +476,7 @@
 	if (llist_empty(&ms_list)) {
 		struct osmocom_ms *ms;
 
-		printf("No Mobile Station defined, creating: MS '1'\n");
+		LOGP(DMOB, LOGL_NOTICE, "No Mobile Station defined, creating: MS '1'\n");
 		ms = mobile_new("1");
 		if (!ms)
 			return -1;

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6af76afbaa34dde5ddfc31a65700030862442dba
Gerrit-Change-Number: 11850
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181121/f3fe7851/attachment.htm>


More information about the gerrit-log mailing list