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
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();
bool is_sdu();
@ -120,7 +120,7 @@ private:
class mac_sch_pdu_nr
{
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();
int unpack(const uint8_t* payload, const uint32_t& len);

@ -22,7 +22,7 @@ extern "C" {
namespace srsran {
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
@ -147,7 +147,7 @@ std::string mac_rar_subpdu_nr::to_string()
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()
{

@ -67,7 +67,7 @@ int32_t mac_sch_subpdu_nr::read_subheader(const uint8_t* ptr)
}
sdu = (uint8_t*)ptr;
} 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 header_length;

@ -47,7 +47,7 @@ static void format_metadata(const detail::log_entry_metadata& metadata, fmt::mem
// Format optional fields if present.
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') {
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
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++) {
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_hex_dump_max_size(args.log.phy_hex_limit);

@ -16,11 +16,11 @@
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_rlc.reset(new rlc_nr("RLC"));
m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP"));
m_rlc.reset(new rlc_nr("RLC-NR"));
m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP-NR"));
m_rrc.reset(new rrc_nr(task_sched.get_timer_handler()));
m_sdap.reset(new sdap());
m_gw.reset(new srsue::gw());

@ -20,9 +20,7 @@
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()
{

@ -19,7 +19,7 @@ using namespace asn1::rrc_nr;
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_,
phy_interface_stack_nr* phy_,

@ -14,7 +14,7 @@
namespace srsue {
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)
{
@ -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
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_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
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_buffer = std::unique_ptr<prach>(new prach(prach_log));
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_) :
task_sched(task_sched_),
logger(srslog::fetch_basic_logger("MAC")),
logger(srslog::fetch_basic_logger("MAC-NR")),
proc_ra(*this, logger),
proc_sr(logger),
proc_bsr(logger),

@ -30,7 +30,7 @@ namespace srsue {
const char* rrc_nr::rrc_nr_state_text[] = {"IDLE", "CONNECTED", "CONNECTED-INACTIVE"};
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;

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

Loading…
Cancel
Save