Change in libosmo-abis[master]: e1d: Use LOGPIL/LOGPITS logging macros to give context

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

laforge gerrit-no-reply at lists.osmocom.org
Sun Jan 12 12:52:42 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/16823 )


Change subject: e1d: Use LOGPIL/LOGPITS logging macros to give context
......................................................................

e1d: Use LOGPIL/LOGPITS logging macros to give context

Change-Id: I88ba83783ae1d8368990ec30cdc7ecff88884e41
---
M src/input/e1d.c
1 file changed, 9 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/23/16823/1

diff --git a/src/input/e1d.c b/src/input/e1d.c
index e111d14..2b67141 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -66,13 +66,13 @@
 
 	ret = read(bfd->fd, msg->data, TS_SIGN_ALLOC_SIZE - 16);
 	if (ret < 0) {
-		LOGP(DLMI, LOGL_ERROR, "%s read failed %d (%s)\n", __func__, ret, strerror(errno));
+		LOGPITS(e1i_ts, DLMI, LOGL_ERROR, "%s read failed %d (%s)\n", __func__, ret, strerror(errno));
 		return ret;
 	}
 
 	msgb_put(msg, ret);
 	if (ret <= 1) {
-		LOGP(DLMI, LOGL_ERROR, "%s read failed %d (%s)\n", __func__, ret, strerror(errno));
+		LOGPITS(e1i_ts, DLMI, LOGL_ERROR, "%s read failed %d (%s)\n", __func__, ret, strerror(errno));
 		return ret;
 	}
 
@@ -130,7 +130,7 @@
 	ret = write(bfd->fd, msg->data, msg->len);
 	msgb_free(msg);
 	if (ret < 0)
-		LOGP(DLMI, LOGL_NOTICE, "%s write failed %d\n", __func__, ret);
+		LOGPITS(e1i_ts, DLMI, LOGL_NOTICE, "%s write failed %d\n", __func__, ret);
 }
 
 static int
@@ -150,8 +150,7 @@
 			ret = handle_ts_sign_write(bfd);
 		break;
 	default:
-		LOGP(DLINP, LOGL_NOTICE,
-			"unknown/unsupported E1 TS type %u\n", e1i_ts->type);
+		LOGPITS(e1i_ts, DLINP, LOGL_NOTICE, "unknown/unsupported E1 TS type %u\n", e1i_ts->type);
 		break;
 	}
 
@@ -164,7 +163,7 @@
 {
         /* We never include the DAHDI B-Channel FD into the writeset */
 	if (e1i_ts->type == E1INP_TS_TYPE_TRAU) {
-		LOGP(DLINP, LOGL_DEBUG, "Trying to write TRAU ts\n");
+		LOGPITS(e1i_ts, DLINP, LOGL_DEBUG, "Trying to write TRAU ts\n");
 		return 0;
 	}
 
@@ -188,7 +187,7 @@
 		return -EINVAL;
 
 
-	LOGP(DLINP, LOGL_NOTICE, "Line update %d %d=E1D(%d:%d) %d\n", line->num, line->port_nr,
+	LOGPIL(line, DLINP, LOGL_NOTICE, "Line update %d %d=E1D(%d:%d) %d\n", line->num, line->port_nr,
 		e1d_intf, e1d_line, line->num_ts);
 
 	for (ts=1; ts<line->num_ts; ts++)
@@ -223,8 +222,7 @@
 								   E1DP_TSMODE_HDLCFCS);
 			}
 			if (bfd->fd < 0) {
-				LOGP(DLINP, LOGL_ERROR,
-					"Could not open timeslot %d\n", ts);
+				LOGPITS(e1i_ts, DLINP, LOGL_ERROR, "Could not open timeslot %d\n", ts);
 				return -EIO;
 			}
 			bfd->when = BSC_FD_READ;
@@ -244,9 +242,7 @@
 
 		ret = osmo_fd_register(bfd);
 		if (ret < 0) {
-			LOGP(DLINP, LOGL_ERROR,
-				"could not register FD: %s\n",
-				strerror(ret));
+			LOGPITS(e1i_ts, DLINP, LOGL_ERROR, "could not register FD: %s\n", strerror(ret));
 			return ret;
 		}
 	}
@@ -266,7 +262,7 @@
 	/* Connect to daemon */
 	g_e1d = osmo_e1dp_client_create(NULL, "/tmp/osmo-e1d.ctl");
 	if (!g_e1d) {
-		 LOGP(DLINP, LOGL_ERROR, "Unable to connect to osmo-e1d daemon\n");
+		LOGP(DLINP, LOGL_ERROR, "Unable to connect to osmo-e1d daemon\n");
 		return -EPIPE;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/16823
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I88ba83783ae1d8368990ec30cdc7ecff88884e41
Gerrit-Change-Number: 16823
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200112/72f879f3/attachment.htm>


More information about the gerrit-log mailing list