Has anyone considered hooking in I18N resource bundles into the logging
framework?
Something like:
log.debug("file.not.found");
where "file.not.found" is a key into a resource bundle and the message that
actually gets logged is language/locale specific?
for backward compatibility, we may have to wrap the key in a special object:
log.debug(new I18N("file.not.found").toString());
and have that I18N class's toString perform the resource bundle lookup.
This would also enable parameters to be passed so the resource bundle's {0},
{1}, ...{n} arguments get replaced:
log.debug(new I18N("file.not.found", new File("/etc/hosts"));
where the resource looks like this:
file.not.found=The file named {0} was not found
There are other issues, such as how do you tell I18N what resource bundle to
actually read from (I18N may actually need to be a class static field to define
something like the commons-logging Logger - or the JBoss logger can use its
category name to determine what resource bundle to use).
Just some off-the-cuff thoughts - was wondering if anyone else was thinking
about I18N logging and/or if anyone is working on something like this?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860482#3860482
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860482
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development