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

Print function name rather than caller #586

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Print function name rather than caller #586

merged 1 commit into from
Feb 14, 2025

Conversation

Y--
Copy link
Collaborator

@Y-- Y-- commented Feb 12, 2025

When an error is raised, we used to print the __func__ string, which contains the current function name where the macro is placed, hence the actual "caller" of the function being wrapped.

This PR replaces the caller name with the name of the function being wrapped.

In an initial version I was displaying both, but found it to be redundant.

An alternative would be to check if caller name contains the function name (or vice-versa) which happens often when we have functions such as TopLevelFunc and TopLevelFunc_cpp, and:

  • if true, only display one
  • if false, display both

But that sounds a bit much.

Happy to hear some feedback :-)

@Y-- Y-- enabled auto-merge (squash) February 12, 2025 16:18
@Y-- Y-- force-pushed the yl/improve-wrappers branch 3 times, most recently from e743937 to 3dd86ad Compare February 12, 2025 16:23
@Y-- Y-- force-pushed the yl/improve-wrappers branch from 3dd86ad to 40a7bd4 Compare February 12, 2025 17:05
Copy link
Collaborator

@JelteF JelteF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. For now at least. We might want to change this once we fix: #523

@Y-- Y-- merged commit a6e4e7a into main Feb 14, 2025
5 checks passed
@Y-- Y-- deleted the yl/improve-wrappers branch February 14, 2025 14:59
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

Successfully merging this pull request may close these issues.

2 participants