From e7239163e9cd8e4e816fb31637885c9b12183e22 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 12 Oct 2020 17:22:14 +0100 Subject: [PATCH] silence noisy unhandled in_sync_ev logs --- lib/include/srslte/common/fsm.h | 21 +++++++++++++++++---- srsue/hdr/stack/rrc/phy_controller.h | 4 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/include/srslte/common/fsm.h b/lib/include/srslte/common/fsm.h index fb36b3d40..70c448dff 100644 --- a/lib/include/srslte/common/fsm.h +++ b/lib/include/srslte/common/fsm.h @@ -64,6 +64,17 @@ struct is_composite_fsm::value>::type> { namespace fsm_details { +/// check whether to log unhandled event +template +auto should_log_unhandled_event(const Event* ev) -> decltype(Event::log_verbose) +{ + return Event::log_verbose; +} +inline bool should_log_unhandled_event(...) +{ + return true; +} + //! Meta-function to filter transition_list by types template struct filter_transition_type; @@ -246,10 +257,12 @@ struct apply_first_guard_pass > { template static bool trigger(FSM* f, SrcState& s, const Event& ev) { - otherfsmDebug(static_cast(f), - "unhandled event caught in state \"%s\": \"%s\"\n", - get_type_name().c_str(), - get_type_name().c_str()); + if (should_log_unhandled_event(&ev)) { + otherfsmDebug(static_cast(f), + "unhandled event caught in state \"%s\": \"%s\"\n", + get_type_name().c_str(), + get_type_name().c_str()); + } return false; } }; diff --git a/srsue/hdr/stack/rrc/phy_controller.h b/srsue/hdr/stack/rrc/phy_controller.h index a90184d22..82c10640b 100644 --- a/srsue/hdr/stack/rrc/phy_controller.h +++ b/srsue/hdr/stack/rrc/phy_controller.h @@ -49,7 +49,9 @@ public: phy_cell_t phy_cell; }; struct cell_search_cmd {}; - struct in_sync_ev {}; + struct in_sync_ev { + static const bool log_verbose = false; + }; struct out_sync_ev {}; explicit phy_controller(phy_interface_rrc_lte* phy_,