In our Scala code we have many trace statements that users may need to understand, so naturally we'd like to document them. Ideally, we should be able to document them in the code itself, and automatically create the documentation from the source code.
The trace strings do not need to be localized, so I would prefer to embed them in the source itself and not place them in a resource file to begin with.
Currently a typical line may read:
trace("value for x is %s" format x)
What I'd like it to be is something like this (though this is a simple example)
trace("value for x is %s" format x) //displays the value of [business name for x]
And then have a tool auto-generate the documentation by parsing the source files and outputting the trace information along with the documentation.
I imagine that it could be done by using annotations and running a custom tool on the source, but I've never done something quite like that before, and would appreciate suggestions.