Great thanks for the explanation.<br>I'll where directed :)<br><br>best regards!<br>Piotr<br><br><br><div class="gmail_quote">On Tue, Jun 23, 2009 at 11:20, "이희승 (Trustin Lee)" <span dir="ltr"><<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>></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;">Hi Piotr,<br>
<br>
Ideally, all frameworks and libraries could use the same logging<br>
framework (java.util.logging) or facade (like commons-logging or slf4j),<br>
but the reality is some people prefers a particular framework (or even<br>
facade) to others. Therefore, sticking to only one logging framework<br>
will often make your users complain. That's why I wrote a thin logging<br>
layer that is just enough for Netty itself.<br>
<br>
For the same reason, I was suggesting you to provide your own logging<br>
layer, but it's up to you. I think using SLF4J is not a bad idea at<br>
all. It's a great facade although it makes some beginners confused and<br>
some people prefers commons logging or just java.util.logging.<br>
<br>
However, if you are going to use Netty's logging layer and expose it to<br>
users directly, you are exposing a logger that is optimized for Netty,<br>
not yours. Its behavior is subject to change at any time to serve the<br>
need of Netty itself, not yours. It actually contains some code that is<br>
specific to Netty class names.<br>
<br>
I know, in most cases, there will be code duplication and its waste of<br>
time and space, but I think this issue should be addressed in a<br>
different project like code generator or byte code manipulator. Until<br>
then, I'd live with code duplication or just choose SLF4J or commons<br>
logging.<br>
<br>
BTW, to change the logging framework in Netty, you can call<br>
InternalLoggerFactory.setDefaultFactory(), and it's absolutely fine. I<br>
did never say that it's prohibited to use InternalLoggerFactory. :)<br>
What's not recommended is to access an InternalLogger, not an<br>
InternalLoggerFactory. So.. your users can call it, too, although it<br>
wouldn't look that beautiful.<br>
<br>
HTH,<br>
<font color="#888888">Trustin<br>
</font><div><div></div><div class="h5"><br>
On 2009-06-23 오후 5:50, Piotr Findeisen wrote:<br>
> Hi, Trustin<br>
><br>
> So should I copy part or the whole Netty's InternalLoggerFactory?<br>
> If I'm going to support logging framework that Netty supports, it would<br>
> mean to copy Netty's code. Well, I very much don't like to copy code --<br>
> this is the reason of my question.<br>
><br>
> Why InternalLogger is marked as internal? What bad can happen if I use<br>
> it? Maybe it could stop being internal?<br>
> Or -- should I use an external factory that serves similar purpose? I<br>
> haven't used it, but maybe SLF4J does the job?<br>
><br>
> regards,<br>
> Piotr<br>
><br>
><br>
> If you are going to provide a logging layer similar to what Netty<br>
> provides, you could write your own InternalLoggerFactory implementation<br>
> that redirects all logs to your logging layer. It should be trivial to<br>
> implement, and the users will not need to touch InternalLoggerFactory at<br>
> all.<br>
><br>
><br>
><br>
</div></div><div><div></div><div class="h5">> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> netty-users mailing list<br>
> <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<br>
<br>
--<br>
— Trustin Lee, <a href="http://gleamynode.net/" target="_blank">http://gleamynode.net/</a><br>
<br>
</div></div><br>_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<br></blockquote></div><br>