Skip to content

Commit 4dbd237

Browse files
Merge pull request #255 from sofa-framework/pr-add-event-message-printing
[Sofa.Core] Print the event when printLog is activated.
2 parents 569d86e + 75a40e5 commit 4dbd237

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Controller.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ void Controller_Trampoline::reinit()
6464
void Controller_Trampoline::callScriptMethod(
6565
const py::object& self, Event* event, const std::string & methodName)
6666
{
67+
if(f_printLog.getValue())
68+
{
69+
std::string name = std::string("on")+event->getClassName();
70+
std::string eventStr = py::str(PythonFactory::toPython(event));
71+
msg_info() << name << " " << eventStr;
72+
}
73+
6774
if( py::hasattr(self, methodName.c_str()) )
6875
{
6976
py::object fct = self.attr(methodName.c_str());

0 commit comments

Comments
 (0)