Debug.logFoo(String, module, param...) pattern

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Debug.logFoo(String, module, param...) pattern

Adam Heath-2
A long time ago, I added support for %-based formatting of log
messages.  I was wondering what the community felt about switching over
to this, instead of using string concatenation.

So, instead of:

Debug.logInfo("I got a  " + inputValue + ", returning " + result, module);

do this:

Debug.logInfo("I got a %s, returning %s", module, inputValue, result);

I think the latter is much easier to deal with, and makes it easier to
translate, if needed.