Introduce LOGTBF* for consistent logging
When troubleshooting complex issues with TBF lifecycle, it's much easier
to follow the logs which are consistently formatted. Add LOGTBF*() macro
similar to struct-specific log routines we use in other Osmocom project
and use it to log TBF-related messages in a unified way. Tweak test
output accordingly.
Related: OS#2407
Change-Id: I388249afefc32d2f6e5cb5e5abc6daf4dbd284ea
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 0bbb817..09ee1f0 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -84,8 +84,7 @@
if (frame->is_complete) {
/* send frame to SGSN */
- LOGP(DRLCMACUL, LOGL_INFO, "%s complete UL frame len=%d\n",
- tbf_name(this) , m_llc.frame_length());
+ LOGPTBFUL(this, LOGL_INFO, "complete UL frame len=%d\n", m_llc.frame_length());
snd_ul_ud();
bts->llc_ul_bytes(m_llc.frame_length());
m_llc.reset();
@@ -128,9 +127,8 @@
if (final) {
if (poll_state == GPRS_RLCMAC_POLL_SCHED &&
ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) {
- LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already "
- "scheduled for %s, so we must wait for "
- "the final uplink ack...\n", tbf_name(this));
+ LOGPTBFUL(this, LOGL_DEBUG,
+ "Polling is already scheduled, so we must wait for the final uplink ack...\n");
return NULL;
}