Skip to content

[Sofa.Core] Print the event when printLog is activated.#255

Merged
damienmarchal merged 1 commit intomasterfrom
pr-add-event-message-printing
Jun 8, 2022
Merged

[Sofa.Core] Print the event when printLog is activated.#255
damienmarchal merged 1 commit intomasterfrom
pr-add-event-message-printing

Conversation

@damienmarchal
Copy link
Copy Markdown
Contributor

@damienmarchal damienmarchal commented May 13, 2022

It is often useful to be able to see what kind of events are received by a controller.

This PR add this behavior by printing the message name and parameters in the console when the 'printLog' data is checked.

[INFO]    [MyController(TOTO)] onUpdateMappingEndEvent {'type': 'UpdateMappingEndEvent', 'isHandled': False}
[INFO]    [MyController(TOTO)] onAnimateBeginEvent {'type': 'AnimateBeginEvent', 'isHandled': False, 'dt': 0.01}
[INFO]    [MyController(TOTO)] onAnimateEndEvent {'type': 'AnimateEndEvent', 'isHandled': False, 'dt': 0.01}
[INFO]    [MyController(TOTO)] onUpdateMappingEndEvent {'type': 'UpdateMappingEndEvent', 'isHandled': False}

Comment thread bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Controller.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pr: status ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants