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

Add the function calls trace in the warning #406

Open
jbrochar opened this issue Aug 3, 2022 · 0 comments
Open

Add the function calls trace in the warning #406

jbrochar opened this issue Aug 3, 2022 · 0 comments
Assignees
Labels
Conceptional The pull request includes conceptional updates

Comments

@jbrochar
Copy link

jbrochar commented Aug 3, 2022

In order to facilitate debugging the warning system could use something similar to the error system and show the nesting of all the function calls that led to the warning.
I believe that it could be quite useful for streamlined used of PsPM, for instance if multiple dataset are analyzed but an issue arise in only one of them. This would provide the (advanced) user with a place to look at to understand the issue, without blocking the processing of the other data sets.

The expected behaviour would look like this:
functionA uses functionB which uses functionC which raises a warning message XXX.
The actual displayed message would be something like :
"/!\ Warning message: /!\
XXX
arised in functionC, from the stack trace:
functionA --> functionB --> functionC "

This could probably be implemented through a special pspm_warning function that would take the same input as the usual warning function but would append the stack trace to the message. To get the stack trace, a function like dbstack (https://uk.mathworks.com/help/matlab/ref/dbstack.html) could be helpful.

@teddychao teddychao self-assigned this Sep 27, 2022
@teddychao teddychao added the Conceptional The pull request includes conceptional updates label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Conceptional The pull request includes conceptional updates
Projects
None yet
Development

No branches or pull requests

2 participants