Expression to get debug string for values. #8207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Often users can get confused on issues where they expect to have a number but actually have a string, or vice-versa, since the broadcasted values look identical.
Solution
This expression turns inputs into strings, but also adds the type of the value to the string. Text is also quoted for clarity:
I kept this simple for now, but more debug options (like conversions, debug info on expressions, etc) could be added later or based on verbosity settings. I intentionally did not use
Classes.getDebugMessage
because it was not very user-friendly:[long:1]
. This has the drawback of not having the built-in debug messages some types include, but the plus side of being easier to read and more standardized between types.Testing Completed
Manual confirmation.
Supporting Information
This is pretty bare-bones, but I didn't want to get all that complex with it right now. I know more could be added, but I'd rather save that complexity for another pr.
Completes: none
Related: none