@@ -32,16 +32,13 @@ void rrc_ue_impl::handle_ul_ccch_pdu(byte_buffer pdu)
3232 asn1::cbit_ref bref (pdu);
3333 if (ul_ccch_msg.unpack (bref) != asn1::SRSASN_SUCCESS or
3434 ul_ccch_msg.msg .type ().value != ul_ccch_msg_type_c::types_opts::c1) {
35- log_rx_pdu_fail (context. ue_index , " CCCH UL " , pdu, " Failed to unpack message " , true );
35+ logger. log_error (pdu. begin (), pdu. end () , " Failed to unpack CCCH UL PDU " );
3636 return ;
3737 }
3838 }
3939
4040 // Log Rx message
41- fmt::memory_buffer fmtbuf, fmtbuf2;
42- fmt::format_to (fmtbuf, " ue={}" , context.ue_index );
43- fmt::format_to (fmtbuf2, " CCCH UL {}" , ul_ccch_msg.msg .c1 ().type ().to_string ());
44- log_rrc_message (to_c_str (fmtbuf), Rx, pdu, ul_ccch_msg, to_c_str (fmtbuf2));
41+ log_rrc_message (logger, Rx, pdu, ul_ccch_msg, " CCCH UL" );
4542
4643 // Handle message
4744 switch (ul_ccch_msg.msg .c1 ().type ().value ) {
@@ -52,7 +49,7 @@ void rrc_ue_impl::handle_ul_ccch_pdu(byte_buffer pdu)
5249 handle_rrc_reest_request (ul_ccch_msg.msg .c1 ().rrc_reest_request ());
5350 break ;
5451 default :
55- log_rx_pdu_fail (context. ue_index , " CCCH UL" , pdu, " Unsupported message type" );
52+ logger. log_error ( " Unsupported CCCH UL message type" );
5653 // TODO Remove user
5754 }
5855}
@@ -128,16 +125,15 @@ void rrc_ue_impl::handle_pdu(const srb_id_t srb_id, byte_buffer rrc_pdu)
128125 asn1::cbit_ref bref (rrc_pdu);
129126 if (ul_dcch_msg.unpack (bref) != asn1::SRSASN_SUCCESS or
130127 ul_dcch_msg.msg .type ().value != ul_dcch_msg_type_c::types_opts::c1) {
131- log_rx_pdu_fail (context. ue_index , " DCCH UL " , rrc_pdu, " Failed to unpack message " , true );
128+ logger. log_error (rrc_pdu. begin (), rrc_pdu. end () , " Failed to unpack DCCH UL PDU " );
132129 return ;
133130 }
134131 }
135132
136133 // Log Rx message
137- fmt::memory_buffer fmtbuf, fmtbuf2;
138- fmt::format_to (fmtbuf, " ue={} {}" , context.ue_index , srb_id);
139- fmt::format_to (fmtbuf2, " DCCH UL {}" , ul_dcch_msg.msg .c1 ().type ().to_string ());
140- log_rrc_message (to_c_str (fmtbuf), Rx, rrc_pdu, ul_dcch_msg, to_c_str (fmtbuf2));
134+ fmt::memory_buffer fmtbuf;
135+ fmt::format_to (fmtbuf, " {} DCCH UL" , srb_id);
136+ log_rrc_message (logger, Rx, rrc_pdu, ul_dcch_msg, to_c_str (fmtbuf));
141137
142138 switch (ul_dcch_msg.msg .c1 ().type ().value ) {
143139 case ul_dcch_msg_type_c::c1_c_::types_opts::options::ul_info_transfer:
@@ -169,7 +165,7 @@ void rrc_ue_impl::handle_pdu(const srb_id_t srb_id, byte_buffer rrc_pdu)
169165 handle_measurement_report (ul_dcch_msg.msg .c1 ().meas_report ());
170166 break ;
171167 default :
172- log_rx_pdu_fail (context. ue_index , " DCCH UL" , rrc_pdu, " Unsupported message type" );
168+ logger. log_error ( " Unsupported DCCH UL message type" );
173169 break ;
174170 }
175171 // TODO: Handle message
@@ -180,12 +176,7 @@ void rrc_ue_impl::handle_ul_dcch_pdu(const srb_id_t srb_id, byte_buffer pdcp_pdu
180176 logger.log_debug (pdcp_pdu.begin (), pdcp_pdu.end (), " RX {} PDCP PDU" , srb_id);
181177
182178 if (context.srbs .find (srb_id) == context.srbs .end ()) {
183- logger.log_error (pdcp_pdu.begin (),
184- pdcp_pdu.end (),
185- " Dropping UlDcchPdu. RX {} is not set up" ,
186- context.ue_index ,
187- context.c_rnti ,
188- srb_id);
179+ logger.log_error (pdcp_pdu.begin (), pdcp_pdu.end (), " Dropping UlDcchPdu. Rx {} is not set up" , srb_id);
189180 return ;
190181 }
191182
@@ -197,13 +188,6 @@ void rrc_ue_impl::handle_ul_dcch_pdu(const srb_id_t srb_id, byte_buffer pdcp_pdu
197188 return ;
198189 }
199190
200- logger.log_debug (rrc_pdu.begin (),
201- rrc_pdu.end (),
202- " RX {} RRC PDU ({} B)" ,
203- context.ue_index ,
204- context.c_rnti ,
205- srb_id,
206- rrc_pdu.length ());
207191 handle_pdu (srb_id, std::move (rrc_pdu));
208192}
209193
@@ -385,10 +369,13 @@ byte_buffer rrc_ue_impl::get_rrc_handover_command(const rrc_reconfiguration_proc
385369 // pack Handover Command
386370 byte_buffer ho_cmd_pdu = pack_into_pdu (ho_cmd);
387371
388- fmt::memory_buffer fmtbuf, fmtbuf2;
389- fmt::format_to (fmtbuf, " ue={}" , context.ue_index );
390- fmt::format_to (fmtbuf2, " {}" , ho_cmd.crit_exts .c1 ().type ().to_string ());
391- log_rrc_message (to_c_str (fmtbuf), Tx, ho_cmd_pdu, ho_cmd, to_c_str (fmtbuf2));
372+ // Log message
373+ logger.log_debug (ho_cmd_pdu.begin (), ho_cmd_pdu.end (), " RrcHandoverCommand ({} B)" , ho_cmd_pdu.length ());
374+ if (logger.get_basic_logger ().debug .enabled ()) {
375+ asn1::json_writer js;
376+ ho_cmd.to_json (js);
377+ logger.log_debug (" Containerized RrcHandoverCommand: {}" , js.to_string ());
378+ }
392379
393380 return ho_cmd_pdu;
394381}
0 commit comments