silence noisy unhandled in_sync_ev logs

master
Francisco Paisana 4 years ago
parent b7ed8b1858
commit e7239163e9

@ -64,6 +64,17 @@ struct is_composite_fsm<T, typename std::enable_if<is_fsm<T>::value>::type> {
namespace fsm_details { namespace fsm_details {
/// check whether to log unhandled event
template <typename Event>
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<Rows...> by <Event, SrcState> types //! Meta-function to filter transition_list<Rows...> by <Event, SrcState> types
template <class Event, class SrcState, class...> template <class Event, class SrcState, class...>
struct filter_transition_type; struct filter_transition_type;
@ -246,10 +257,12 @@ struct apply_first_guard_pass<FSM, type_list<> > {
template <typename SrcState, typename Event> template <typename SrcState, typename Event>
static bool trigger(FSM* f, SrcState& s, const Event& ev) static bool trigger(FSM* f, SrcState& s, const Event& ev)
{ {
if (should_log_unhandled_event(&ev)) {
otherfsmDebug(static_cast<typename FSM::derived_t*>(f), otherfsmDebug(static_cast<typename FSM::derived_t*>(f),
"unhandled event caught in state \"%s\": \"%s\"\n", "unhandled event caught in state \"%s\": \"%s\"\n",
get_type_name<SrcState>().c_str(), get_type_name<SrcState>().c_str(),
get_type_name<Event>().c_str()); get_type_name<Event>().c_str());
}
return false; return false;
} }
}; };

@ -49,7 +49,9 @@ public:
phy_cell_t phy_cell; phy_cell_t phy_cell;
}; };
struct cell_search_cmd {}; struct cell_search_cmd {};
struct in_sync_ev {}; struct in_sync_ev {
static const bool log_verbose = false;
};
struct out_sync_ev {}; struct out_sync_ev {};
explicit phy_controller(phy_interface_rrc_lte* phy_, explicit phy_controller(phy_interface_rrc_lte* phy_,

Loading…
Cancel
Save