I have a library for doing this for my own codebase. I would be happy to donate 
a license and source to TS.

Basically there is an XML file that describes the messages. During a build it 
generates C++ code to define a table of messages and creates a set of constants 
for the message values or logging functions (or both). So instead of using 
Debug("tag", "format", arg, arg, arg) you would have a function Tag(arg, arg, 
arg) which would generate the log. You can tweak around the names and 
namespaces as needed. One of the things I came to like about this was the 
typechecking on the debug arguments. The message file format supports 
specialized types for arguments (in effect you can define a mapping from format 
codes to C++ types). If there  is any interest at all, I write up some 
documentation.

Saturday, December 1, 2012, 1:07:57 PM, you wrote:

> [snip] 
>> > Another side note: Has anyone considered borrowing httpd's idea of
>> > uniquely numbering each error log message?

>> That's a great idea ... how do they manage automation of message
>> number assignments?
>  
> Please see: 

>   https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/log-message-tags

Reply via email to