What I would love to have is an equivalent to C predefined macros:
__LINE__ - expands to the line number of the source file where it's encountered
__FILE__ - expands to the source file name
__VERSION__ - expands to the version of the compiler used to compile the source
I do most of my debugging with logs and while it's easy to find the position in the source file with the unique log message, sometimes I write "logging function" which dumps a data structure, or state or something like that. And I would like to have a simple way to correlate the log output for such function with the position it was called from.
@paf31 suggested to exploit failed pattern match messages, but while it's good for logging errors in case of catastrophic failure, I believe it's too expensive for casual high volume debug logging.
What I would love to have is an equivalent to C predefined macros:
__LINE__- expands to the line number of the source file where it's encountered__FILE__- expands to the source file name__VERSION__- expands to the version of the compiler used to compile the sourceI do most of my debugging with logs and while it's easy to find the position in the source file with the unique log message, sometimes I write "logging function" which dumps a data structure, or state or something like that. And I would like to have a simple way to correlate the log output for such function with the position it was called from.
@paf31 suggested to exploit failed pattern match messages, but while it's good for logging errors in case of catastrophic failure, I believe it's too expensive for casual high volume debug logging.