Fix append NR to loggers for NR components

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent c2a99a8112
commit 7823bfc28c

@ -54,7 +54,7 @@ public:
// SDUs up to 256 B can use the short 8-bit L field // SDUs up to 256 B can use the short 8-bit L field
static const int32_t MAC_SUBHEADER_LEN_THRESHOLD = 256; static const int32_t MAC_SUBHEADER_LEN_THRESHOLD = 256;
mac_sch_subpdu_nr(mac_sch_pdu_nr* parent_) : parent(parent_), logger(&srslog::fetch_basic_logger("MAC")){}; mac_sch_subpdu_nr(mac_sch_pdu_nr* parent_) : parent(parent_), logger(&srslog::fetch_basic_logger("MAC-NR")){};
nr_lcid_sch_t get_type(); nr_lcid_sch_t get_type();
bool is_sdu(); bool is_sdu();
@ -120,7 +120,7 @@ private:
class mac_sch_pdu_nr class mac_sch_pdu_nr
{ {
public: public:
mac_sch_pdu_nr(bool ulsch_ = false) : ulsch(ulsch_), logger(srslog::fetch_basic_logger("MAC")) {} mac_sch_pdu_nr(bool ulsch_ = false) : ulsch(ulsch_), logger(srslog::fetch_basic_logger("MAC-NR")) {}
void pack(); void pack();
int unpack(const uint8_t* payload, const uint32_t& len); int unpack(const uint8_t* payload, const uint32_t& len);

@ -22,7 +22,7 @@ extern "C" {
namespace srsran { namespace srsran {
mac_rar_subpdu_nr::mac_rar_subpdu_nr(mac_rar_pdu_nr* parent_) : mac_rar_subpdu_nr::mac_rar_subpdu_nr(mac_rar_pdu_nr* parent_) :
parent(parent_), logger(srslog::fetch_basic_logger("MAC")) parent(parent_), logger(srslog::fetch_basic_logger("MAC-NR"))
{} {}
// Return true if subPDU could be parsed correctly, false otherwise // Return true if subPDU could be parsed correctly, false otherwise
@ -147,7 +147,7 @@ std::string mac_rar_subpdu_nr::to_string()
return ss.str(); return ss.str();
} }
mac_rar_pdu_nr::mac_rar_pdu_nr() : logger(srslog::fetch_basic_logger("MAC")) {} mac_rar_pdu_nr::mac_rar_pdu_nr() : logger(srslog::fetch_basic_logger("MAC-NR")) {}
bool mac_rar_pdu_nr::pack() bool mac_rar_pdu_nr::pack()
{ {

@ -67,7 +67,7 @@ int32_t mac_sch_subpdu_nr::read_subheader(const uint8_t* ptr)
} }
sdu = (uint8_t*)ptr; sdu = (uint8_t*)ptr;
} else { } else {
srslog::fetch_basic_logger("MAC").warning("Invalid LCID (%d) in MAC PDU", lcid); srslog::fetch_basic_logger("MAC-NR").warning("Invalid LCID (%d) in MAC PDU", lcid);
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
return header_length; return header_length;

@ -47,7 +47,7 @@ static void format_metadata(const detail::log_entry_metadata& metadata, fmt::mem
// Format optional fields if present. // Format optional fields if present.
if (!metadata.log_name.empty()) { if (!metadata.log_name.empty()) {
fmt::format_to(buffer, "[{: <4}] ", metadata.log_name); fmt::format_to(buffer, "[{: <7}] ", metadata.log_name);
} }
if (metadata.log_tag != '\0') { if (metadata.log_tag != '\0') {
fmt::format_to(buffer, "[{}] ", metadata.log_tag); fmt::format_to(buffer, "[{}] ", metadata.log_tag);

@ -21,7 +21,7 @@ bool worker_pool::init(const phy_args_t& args, phy_common* common, srslog::sink&
// Add workers to workers pool and start threads // Add workers to workers pool and start threads
srslog::basic_levels log_level = srslog::str_to_basic_level(args.log.phy_level); srslog::basic_levels log_level = srslog::str_to_basic_level(args.log.phy_level);
for (uint32_t i = 0; i < args.nof_phy_threads; i++) { for (uint32_t i = 0; i < args.nof_phy_threads; i++) {
auto& log = srslog::fetch_basic_logger(fmt::format("PHY{}", i), log_sink); auto& log = srslog::fetch_basic_logger(fmt::format("PHY{}-NR", i), log_sink);
log.set_level(log_level); log.set_level(log_level);
log.set_hex_dump_max_size(args.log.phy_hex_limit); log.set_hex_dump_max_size(args.log.phy_hex_limit);

@ -16,11 +16,11 @@
namespace srsenb { namespace srsenb {
gnb_stack_nr::gnb_stack_nr() : task_sched{512, 128}, thread("gNB"), rlc_logger(srslog::fetch_basic_logger("RLC")) gnb_stack_nr::gnb_stack_nr() : task_sched{512, 128}, thread("gNB"), rlc_logger(srslog::fetch_basic_logger("RLC-NR"))
{ {
m_mac.reset(new mac_nr()); m_mac.reset(new mac_nr());
m_rlc.reset(new rlc_nr("RLC")); m_rlc.reset(new rlc_nr("RLC-NR"));
m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP")); m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP-NR"));
m_rrc.reset(new rrc_nr(task_sched.get_timer_handler())); m_rrc.reset(new rrc_nr(task_sched.get_timer_handler()));
m_sdap.reset(new sdap()); m_sdap.reset(new sdap());
m_gw.reset(new srsue::gw()); m_gw.reset(new srsue::gw());

@ -20,9 +20,7 @@
namespace srsenb { namespace srsenb {
mac_nr::mac_nr() : logger(srslog::fetch_basic_logger("MAC")) mac_nr::mac_nr() : logger(srslog::fetch_basic_logger("MAC-NR")) {}
{
}
mac_nr::~mac_nr() mac_nr::~mac_nr()
{ {

@ -19,7 +19,7 @@ using namespace asn1::rrc_nr;
namespace srsenb { namespace srsenb {
rrc_nr::rrc_nr(srsran::timer_handler* timers_) : logger(srslog::fetch_basic_logger("RRC")), timers(timers_) {} rrc_nr::rrc_nr(srsran::timer_handler* timers_) : logger(srslog::fetch_basic_logger("RRC-NR")), timers(timers_) {}
int rrc_nr::init(const rrc_nr_cfg_t& cfg_, int rrc_nr::init(const rrc_nr_cfg_t& cfg_,
phy_interface_stack_nr* phy_, phy_interface_stack_nr* phy_,

@ -14,7 +14,7 @@
namespace srsue { namespace srsue {
namespace nr { namespace nr {
worker_pool::worker_pool(uint32_t max_workers) : pool(max_workers), logger(srslog::fetch_basic_logger("NR-PHY")) {} worker_pool::worker_pool(uint32_t max_workers) : pool(max_workers), logger(srslog::fetch_basic_logger("PHY-NR")) {}
bool worker_pool::init(const phy_args_nr_t& args, phy_common* common, stack_interface_phy_nr* stack_, int prio) bool worker_pool::init(const phy_args_nr_t& args, phy_common* common, stack_interface_phy_nr* stack_, int prio)
{ {
@ -36,7 +36,7 @@ bool worker_pool::init(const phy_args_nr_t& args, phy_common* common, stack_inte
// Add workers to workers pool and start threads // Add workers to workers pool and start threads
for (uint32_t i = 0; i < args.nof_phy_threads; i++) { for (uint32_t i = 0; i < args.nof_phy_threads; i++) {
auto& log = srslog::fetch_basic_logger(fmt::format("PHY{}", i)); auto& log = srslog::fetch_basic_logger(fmt::format("PHY{}-NR", i));
log.set_level(srslog::str_to_basic_level(args.log.phy_level)); log.set_level(srslog::str_to_basic_level(args.log.phy_level));
log.set_hex_dump_max_size(args.log.phy_hex_limit); log.set_hex_dump_max_size(args.log.phy_hex_limit);
@ -50,7 +50,7 @@ bool worker_pool::init(const phy_args_nr_t& args, phy_common* common, stack_inte
} }
// Initialise PRACH // Initialise PRACH
auto& prach_log = srslog::fetch_basic_logger("PRACH"); auto& prach_log = srslog::fetch_basic_logger("PRACH-NR");
prach_log.set_level(srslog::str_to_basic_level(args.log.phy_level)); prach_log.set_level(srslog::str_to_basic_level(args.log.phy_level));
prach_buffer = std::unique_ptr<prach>(new prach(prach_log)); prach_buffer = std::unique_ptr<prach>(new prach(prach_log));
prach_buffer->init(phy_state.args.dl.nof_max_prb); prach_buffer->init(phy_state.args.dl.nof_max_prb);

@ -19,7 +19,7 @@ namespace srsue {
mac_nr::mac_nr(srsran::ext_task_sched_handle task_sched_) : mac_nr::mac_nr(srsran::ext_task_sched_handle task_sched_) :
task_sched(task_sched_), task_sched(task_sched_),
logger(srslog::fetch_basic_logger("MAC")), logger(srslog::fetch_basic_logger("MAC-NR")),
proc_ra(*this, logger), proc_ra(*this, logger),
proc_sr(logger), proc_sr(logger),
proc_bsr(logger), proc_bsr(logger),

@ -30,7 +30,7 @@ namespace srsue {
const char* rrc_nr::rrc_nr_state_text[] = {"IDLE", "CONNECTED", "CONNECTED-INACTIVE"}; const char* rrc_nr::rrc_nr_state_text[] = {"IDLE", "CONNECTED", "CONNECTED-INACTIVE"};
rrc_nr::rrc_nr(srsran::task_sched_handle task_sched_) : rrc_nr::rrc_nr(srsran::task_sched_handle task_sched_) :
logger(srslog::fetch_basic_logger("RRC")), task_sched(task_sched_), conn_recfg_proc(this) logger(srslog::fetch_basic_logger("RRC-NR")), task_sched(task_sched_), conn_recfg_proc(this)
{} {}
rrc_nr::~rrc_nr() = default; rrc_nr::~rrc_nr() = default;

@ -18,16 +18,16 @@ using namespace srsran;
namespace srsue { namespace srsue {
ue_stack_nr::ue_stack_nr() : ue_stack_nr::ue_stack_nr() :
thread("STACK"), thread("STACK-NR"),
task_sched(64, 64), task_sched(64, 64),
mac_logger(srslog::fetch_basic_logger("MAC")), mac_logger(srslog::fetch_basic_logger("MAC-NR")),
rlc_logger(srslog::fetch_basic_logger("RLC", false)), rlc_logger(srslog::fetch_basic_logger("RLC-NR", false)),
pdcp_logger(srslog::fetch_basic_logger("PDCP", false)) pdcp_logger(srslog::fetch_basic_logger("PDCP-NR", false))
{ {
get_background_workers().set_nof_workers(2); get_background_workers().set_nof_workers(2);
mac.reset(new mac_nr(&task_sched)); mac.reset(new mac_nr(&task_sched));
pdcp.reset(new srsran::pdcp(&task_sched, "PDCP")); pdcp.reset(new srsran::pdcp(&task_sched, "PDCP-NR"));
rlc.reset(new srsran::rlc("RLC")); rlc.reset(new srsran::rlc("RLC-NR"));
rrc.reset(new rrc_nr(&task_sched)); rrc.reset(new rrc_nr(&task_sched));
// setup logging for pool, RLC and PDCP // setup logging for pool, RLC and PDCP

Loading…
Cancel
Save