diff --git a/srsenb/src/stack/gnb_stack_nr.cc b/srsenb/src/stack/gnb_stack_nr.cc index d287d2888..abf148c08 100644 --- a/srsenb/src/stack/gnb_stack_nr.cc +++ b/srsenb/src/stack/gnb_stack_nr.cc @@ -23,7 +23,7 @@ gnb_stack_nr::gnb_stack_nr() : task_sched{512, 128}, thread("gNB"), rlc_logger(s m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP-NR")); m_rrc.reset(new rrc_nr(&task_sched)); m_sdap.reset(new sdap()); - m_gw.reset(new srsue::gw()); + m_gw.reset(new srsue::gw(srslog::fetch_basic_logger("GW"))); // m_gtpu.reset(new srsenb::gtpu()); ue_task_queue = task_sched.make_task_queue(); diff --git a/srsue/hdr/stack/upper/gw.h b/srsue/hdr/stack/upper/gw.h index dc36f38ea..8ea0a345b 100644 --- a/srsue/hdr/stack/upper/gw.h +++ b/srsue/hdr/stack/upper/gw.h @@ -43,7 +43,7 @@ struct gw_args_t { class gw : public gw_interface_stack, public srsran::thread { public: - gw(); + gw(srslog::basic_logger& logger_); int init(const gw_args_t& args_, stack_interface_gw* stack); void stop(); diff --git a/srsue/hdr/stack/upper/nas.h b/srsue/hdr/stack/upper/nas.h index 2294096f4..bfb4d2a6a 100644 --- a/srsue/hdr/stack/upper/nas.h +++ b/srsue/hdr/stack/upper/nas.h @@ -38,7 +38,7 @@ class rrc_interface_nas; class nas : public nas_interface_rrc, public srsran::timer_callback, public nas_base { public: - explicit nas(srsran::task_sched_handle task_sched_); + explicit nas(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_); virtual ~nas(); int init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_nas* gw_, const nas_args_t& args_); void stop(); diff --git a/srsue/hdr/stack/upper/nas_5g.h b/srsue/hdr/stack/upper/nas_5g.h index 34171d605..484e55875 100644 --- a/srsue/hdr/stack/upper/nas_5g.h +++ b/srsue/hdr/stack/upper/nas_5g.h @@ -35,7 +35,7 @@ namespace srsue { class nas_5g : public nas_base, public nas_5g_interface_rrc_nr, public nas_5g_interface_procedures { public: - explicit nas_5g(srsran::task_sched_handle task_sched_); + explicit nas_5g(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_); virtual ~nas_5g(); int init(usim_interface_nas* usim_, rrc_nr_interface_nas_5g* rrc_nr_, gw_interface_nas* gw_, const nas_args_t& cfg_); void stop(); diff --git a/srsue/hdr/stack/upper/nas_base.h b/srsue/hdr/stack/upper/nas_base.h index 225278146..68d4ec151 100644 --- a/srsue/hdr/stack/upper/nas_base.h +++ b/srsue/hdr/stack/upper/nas_base.h @@ -28,7 +28,7 @@ namespace srsue { class nas_base { public: - nas_base(const std::string& type_); + nas_base(srslog::basic_logger& logger_); // PCAP void start_pcap(srsran::nas_pcap* pcap_) { pcap = pcap_; } diff --git a/srsue/src/stack/rrc/test/rrc_meas_test.cc b/srsue/src/stack/rrc/test/rrc_meas_test.cc index 1c438ebf0..530d4f2f5 100644 --- a/srsue/src/stack/rrc/test/rrc_meas_test.cc +++ b/srsue/src/stack/rrc/test/rrc_meas_test.cc @@ -187,7 +187,7 @@ public: class nas_test : public srsue::nas { public: - nas_test(srsran::task_sched_handle t) : srsue::nas(t) {} + nas_test(srsran::task_sched_handle t) : srsue::nas(srslog::fetch_basic_logger("NAS"), t) {} bool is_registered() override { return false; } }; diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 4bef269a1..3d84ea6ab 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -50,7 +50,7 @@ ue_stack_lte::ue_stack_lte() : rrc_nr(&task_sched), pdcp(&task_sched, "PDCP"), pdcp_nr(&task_sched, "PDCP-NR"), - nas(&task_sched), + nas(srslog::fetch_basic_logger("NAS", false), &task_sched), thread("STACK"), task_sched(512, 64), tti_tprof("tti_tprof", "STCK", TTI_STAT_PERIOD) diff --git a/srsue/src/stack/upper/gw.cc b/srsue/src/stack/upper/gw.cc index 4ae579421..af75a7438 100644 --- a/srsue/src/stack/upper/gw.cc +++ b/srsue/src/stack/upper/gw.cc @@ -29,7 +29,7 @@ namespace srsue { -gw::gw() : thread("GW"), logger(srslog::fetch_basic_logger("GW", false)), tft_matcher(logger) {} +gw::gw(srslog::basic_logger& logger_) : thread("GW"), logger(logger_), tft_matcher(logger) {} int gw::init(const gw_args_t& args_, stack_interface_gw* stack_) { diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index 7a228a209..489026d04 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -34,8 +34,8 @@ namespace srsue { * NAS ********************************************************************/ -nas::nas(srsran::task_sched_handle task_sched_) : - nas_base("NAS"), +nas::nas(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_) : + nas_base(logger_), plmn_searcher(this), task_sched(task_sched_), t3402(task_sched_.get_unique_timer()), diff --git a/srsue/src/stack/upper/nas_5g.cc b/srsue/src/stack/upper/nas_5g.cc index 97718fc75..a210af22f 100644 --- a/srsue/src/stack/upper/nas_5g.cc +++ b/srsue/src/stack/upper/nas_5g.cc @@ -36,8 +36,8 @@ namespace srsue { * NAS 5G (NR) ********************************************************************/ -nas_5g::nas_5g(srsran::task_sched_handle task_sched_) : - nas_base("NAS-5G"), +nas_5g::nas_5g(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_) : + nas_base(logger_), task_sched(task_sched_), t3502(task_sched_.get_unique_timer()), t3510(task_sched_.get_unique_timer()), diff --git a/srsue/src/stack/upper/nas_base.cc b/srsue/src/stack/upper/nas_base.cc index b4a01f76a..635213d58 100644 --- a/srsue/src/stack/upper/nas_base.cc +++ b/srsue/src/stack/upper/nas_base.cc @@ -14,7 +14,7 @@ using namespace srsran; namespace srsue { -nas_base::nas_base(const std::string& type_) : logger(srslog::fetch_basic_logger(type_)) {} +nas_base::nas_base(srslog::basic_logger& logger_) : logger(logger_) {} int nas_base::parse_security_algorithm_list(std::string algorithm_string, bool* algorithm_caps) { diff --git a/srsue/src/stack/upper/test/gw_test.cc b/srsue/src/stack/upper/test/gw_test.cc index 9aa26226a..0198e2e8a 100644 --- a/srsue/src/stack/upper/test/gw_test.cc +++ b/srsue/src/stack/upper/test/gw_test.cc @@ -33,7 +33,7 @@ int gw_test() gw_args.log.gw_level = "debug"; gw_args.log.gw_hex_limit = 100000; test_stack_dummy stack; - srsue::gw gw; + srsue::gw gw(srslog::fetch_basic_logger("GW")); gw.init(gw_args, &stack); uint32_t eps_bearer_id = 5; diff --git a/srsue/src/stack/upper/test/nas_5g_test.cc b/srsue/src/stack/upper/test/nas_5g_test.cc index 8556e326a..5a48ead48 100644 --- a/srsue/src/stack/upper/test/nas_5g_test.cc +++ b/srsue/src/stack/upper/test/nas_5g_test.cc @@ -49,8 +49,8 @@ int amf_attach_request_test(srsran::nas_pcap* pcap) nas_cfg.ea5g = "0,1,2,3"; test_stack_dummy stack(&pdcp_dummy); - srsue::nas_5g nas_5g(&stack.task_sched); - srsue::gw gw; + srsue::nas_5g nas_5g(srslog::fetch_basic_logger("NAS-5G"), &stack.task_sched); + srsue::gw gw(srslog::fetch_basic_logger("GW")); if (pcap != nullptr) { nas_5g.start_pcap(pcap); diff --git a/srsue/src/stack/upper/test/nas_test.cc b/srsue/src/stack/upper/test/nas_test.cc index 825d29ee4..edbc5e72a 100644 --- a/srsue/src/stack/upper/test/nas_test.cc +++ b/srsue/src/stack/upper/test/nas_test.cc @@ -59,8 +59,8 @@ int mme_attach_request_test() nas_cfg.apn_name = "test123"; test_stack_dummy stack(&pdcp_dummy); - srsue::nas nas(&stack.task_sched); - srsue::gw gw; + srsue::nas nas(srslog::fetch_basic_logger("NAS"), &stack.task_sched); + srsue::gw gw(srslog::fetch_basic_logger("GW")); nas.init(&usim, &rrc_dummy, &gw, nas_cfg); rrc_dummy.init(&nas); @@ -124,7 +124,7 @@ int security_command_test() usim.init(&args); { - srsue::nas nas(&stack.task_sched); + srsue::nas nas(srslog::fetch_basic_logger("NAS"), &stack.task_sched); nas_args_t cfg; cfg.eia = "1,2,3"; cfg.eea = "0,1,2,3"; @@ -179,7 +179,7 @@ int esm_info_request_test() usim.init(&args); { - srsue::nas nas(&stack.task_sched); + srsue::nas nas(srslog::fetch_basic_logger("NAS-5G"), &stack.task_sched); nas_args_t cfg; cfg.apn_name = "srsran"; cfg.apn_user = "srsuser"; @@ -223,7 +223,7 @@ int dedicated_eps_bearer_test() srsue::usim usim(srslog::fetch_basic_logger("USIM")); usim.init(&args); - srsue::nas nas(&stack.task_sched); + srsue::nas nas(srslog::fetch_basic_logger("NAS"), &stack.task_sched); nas_args_t cfg = {}; cfg.force_imsi_attach = true; // make sure we get a fresh security context cfg.eia = "1,2,3"; diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index e5413776f..484ec23bb 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -61,7 +61,7 @@ int ue::init(const all_args_t& args_) return SRSRAN_ERROR; } - std::unique_ptr gw_ptr(new gw()); + std::unique_ptr gw_ptr(new gw(srslog::fetch_basic_logger("GW"))); if (!gw_ptr) { srsran::console("Error creating a GW instance.\n"); return SRSRAN_ERROR; @@ -123,7 +123,7 @@ int ue::init(const all_args_t& args_) std::unique_ptr nr_stack(new srsue::ue_stack_nr()); std::unique_ptr nr_radio(new srsran::radio_null); std::unique_ptr nr_phy; - std::unique_ptr gw_ptr(new gw()); + std::unique_ptr gw_ptr(new gw(srslog::fetch_basic_logger("GW"))); // Init layers if (nr_radio->init(args.rf, nullptr)) {