Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support to redirect iDynTree errors to a specified function #1064

Open
traversaro opened this issue Apr 12, 2023 · 0 comments
Open

Comments

@traversaro
Copy link
Member

traversaro commented Apr 12, 2023

At the moment, iDynTree prints all its error/messages to std::cout/std::cerr or stdout/stderr. This works fine if one uses iDynTree just in a terminal application, but can be problematic if iDynTree is used in a GUI application (for example, as part of a plugin), as in that case the iDynTree error messages should be redirected somewhere else, where the user/developer can see them. In theory std::cout and std::cerr can also be redirected (see https://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files), but that it a global operation that may affect also non-iDynTree messages.

To support the use cases in which iDynTree messages want to be redirected, we could use spdlog as we did for other libraries we developed in the lab, however if anyone has some better idea please comment, thanks!

cc @Nicogene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant