<br><br><div class="gmail_quote">On Thu, Aug 20, 2009 at 10:07 AM, Takeshi Kondo <span dir="ltr">&lt;<a href="mailto:takeshi.kondo@gmail.com">takeshi.kondo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
If log level is separated, logging code is<br>
----<br>
public class enum LogMessages{<br>
   @Debug(&quot;debug log message&quot;)<br>
   TEST0001<br>
}<br>
<br>
if(logger.isEnableFor(LogMessages.TEST0001)){<br>
   logger.log(LogMessages.TEST0001);<br>
}<br>
----<br>
If change log level, logger.isEnableFor(LogMessages.TEST0001) is true , then  log event occur.</blockquote><div><br>Actually, when using logger.log(LogMessages.TEST0001) isEnableFor is useless and shouldn&#39;t be called. The log method is going to do that check again. But your point is well taken that the application programmer doesn&#39;t have to know the log level when writing the code.<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Of course, if we can change log configuration, it is usually solved. But because log configuration is per category,it can&#39;t configure per log message id.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Instead of debating the requirements, how about code that embodies your vision of the API (assuming everything was possible)?<br>
<br>
For example, here is a vision of the i18n API:<br>
<br>
 LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();<br>
 lc.addResourceBundle( aResourceBundle);<br>
<br>
 Logger loggerA =  LoggerFactory.getLogger(&quot;A&quot;);<br>
 Logger loggerB =  LoggerFactory.getLogger(&quot;B&quot;);<br>
<br>
 // replace key_0 with its corresponding value in aResourceBundle<br>
 loggerA.info(&quot;key_0&quot;);<br>
<br>
 // same as before, but also insert the value of &quot;param&quot; as specified in<br>
 // the message<br>
 loggerB.info(&quot;key_1&quot;, param);<br>
<br>
The above is just an *example* of what I mean by &quot;vision&quot; of the API.<br>
<br>
You can go a step further an implement something. You may wish to fork SLF4J on git. The url is <a href="http://github.com/ceki/slf4j/tree/master" target="_blank">http://github.com/ceki/slf4j/tree/master</a><br>
</blockquote></div>
OK. I&#39;ve develop initial thought of  i18n API on this week end.<br>
<br>
</blockquote><div><br>I&#39;d love to see what you come up with. I&#39;m seriously thinking that XLogger could be enhanced with some of these ideas.<br><br>Ralph <br></div></div><br>