Skip to content

Commit 836b7f5

Browse files
committed
Add num_handlers binding to MessageDispatcher and rename clearHandlers to clear_handlers
1 parent 734f018 commit 836b7f5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

bindings/Sofa/src/SofaPython3/Sofa/Helper/Binding_MessageDispatcher.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ void sofapython3::moduleAddMessageDispatcher(pybind11::module &m)
3333
Configuration of the message dispatcher.
3434
)doc";
3535

36-
messageDispatcherModule.def("clearHandlers",
36+
messageDispatcherModule.def("clear_handlers",
3737
[](){
3838
sofa::helper::logging::MessageDispatcher::clearHandlers();
3939
}, "Removes all registered message handlers.");
40+
41+
messageDispatcherModule.def("num_handlers",
42+
[](){
43+
return sofa::helper::logging::MessageDispatcher::getHandlers().size();
44+
}, "Returns the number of registered message handlers.");
4045
}

0 commit comments

Comments
 (0)