You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2007/07/27 10:12:39 UTC
Integrating SessionLog into IoSession
Hi community,
Sorry for flooding idea, but I got some free time today. :)
Currently, we log messages from IoHandler like the following:
SessionLog.info(session, "message");
What about integrating this feature into IoSession like the following?
// getLogger() returns SLF4J Logger. Category will be the FQCN of the
IoHandler.
session.getLogger().info(session, "message");
// Category can be overriden if requested.
session.getLogger(Main.class).info(session, "message 2");
There won't be any performance difference IMO.
I'm not sure it's a good idea to integrate with SLF4J tightly, so
please let me know what you think about it.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: Integrating SessionLog into IoSession
Posted by Mark <el...@gmail.com>.
I like this better.
On 8/14/07, Trustin Lee <tr...@gmail.com> wrote:
>
> On 8/2/07, peter royal <pr...@apache.org> wrote:
> > On Jul 27, 2007, at 4:15 AM, Mark Webb wrote:
> > > I am thinking that it might be best to keep the two separate. The
> > > separation of the session and slf4j is best IMHO.
> >
> > I'm also in favor of keeping them separate.
>
> Than what do you think about replacing SessionLog with a new class
> 'IoSessionLogger':
>
> Logger log = new IoSessionLogger(LogFactory.getLogger(MyIoHandler.class));
>
> We could provide all static methods existed in SessionLog for
> IoSessionLogger, but IoSessionLogger is more flexible in that it
> implements SLF4J Logger interface so it can be used by any other
> SLF4J-aware components.
>
> WDYT?
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
--
..Cheers
Mark
Re: Integrating SessionLog into IoSession
Posted by Trustin Lee <tr...@gmail.com>.
On 8/2/07, peter royal <pr...@apache.org> wrote:
> On Jul 27, 2007, at 4:15 AM, Mark Webb wrote:
> > I am thinking that it might be best to keep the two separate. The
> > separation of the session and slf4j is best IMHO.
>
> I'm also in favor of keeping them separate.
Than what do you think about replacing SessionLog with a new class
'IoSessionLogger':
Logger log = new IoSessionLogger(LogFactory.getLogger(MyIoHandler.class));
We could provide all static methods existed in SessionLog for
IoSessionLogger, but IoSessionLogger is more flexible in that it
implements SLF4J Logger interface so it can be used by any other
SLF4J-aware components.
WDYT?
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: Integrating SessionLog into IoSession
Posted by peter royal <pr...@apache.org>.
On Jul 27, 2007, at 4:15 AM, Mark Webb wrote:
> I am thinking that it might be best to keep the two separate. The
> separation of the session and slf4j is best IMHO.
I'm also in favor of keeping them separate.
-pete
--
proyal@apache.org - http://fotap.org/~osi
Re: Integrating SessionLog into IoSession
Posted by Maarten Bosteels <mb...@gmail.com>.
I like Trustin's idea.
IMHO better than the static SessionLog,
And I don't care about the coupling with SLF4J since MINA already depends on
it.
Maarten
On 7/27/07, Mark Webb <el...@gmail.com> wrote:
>
> I am thinking that it might be best to keep the two separate. The
> separation of the session and slf4j is best IMHO.
>
> On 7/27/07, 向秦贤 <fy...@gmail.com> wrote:
> >
> > hi,
> > +1, change to session.getLogger();
> >
> > About slf4j, No dout tighty.
> > If no use of slf4j, we must do another style log utility, and there are
> > only
> > options.
> > So, go ahead courageously sister:) (topic song of movie <Red Sorghum >)
> >
> > 2007/7/27, Trustin Lee <tr...@gmail.com>:
> > >
> > > Hi community,
> > >
> > > Sorry for flooding idea, but I got some free time today. :)
> > >
> > > Currently, we log messages from IoHandler like the following:
> > >
> > > SessionLog.info(session, "message");
> > >
> > > What about integrating this feature into IoSession like the following?
> > >
> > > // getLogger() returns SLF4J Logger. Category will be the FQCN of the
> > > IoHandler.
> > > session.getLogger().info(session, "message");
> > > // Category can be overriden if requested.
> > > session.getLogger(Main.class).info(session, "message 2");
> > >
> > > There won't be any performance difference IMO.
> > >
> > > I'm not sure it's a good idea to integrate with SLF4J tightly, so
> > > please let me know what you think about it.
> > >
> > > Trustin
> > > --
> > > what we call human nature is actually human habit
> > > --
> > > http://gleamynode.net/
> > > --
> > > PGP Key ID: 0x0255ECA6
> > >
> >
> >
> >
> > --
> > 致敬
> > 向秦贤
> >
>
>
>
> --
> ..Cheers
> Mark
>
Re: Integrating SessionLog into IoSession
Posted by Mark Webb <el...@gmail.com>.
I am thinking that it might be best to keep the two separate. The
separation of the session and slf4j is best IMHO.
On 7/27/07, 向秦贤 <fy...@gmail.com> wrote:
>
> hi,
> +1, change to session.getLogger();
>
> About slf4j, No dout tighty.
> If no use of slf4j, we must do another style log utility, and there are
> only
> options.
> So, go ahead courageously sister:) (topic song of movie <Red Sorghum >)
>
> 2007/7/27, Trustin Lee <tr...@gmail.com>:
> >
> > Hi community,
> >
> > Sorry for flooding idea, but I got some free time today. :)
> >
> > Currently, we log messages from IoHandler like the following:
> >
> > SessionLog.info(session, "message");
> >
> > What about integrating this feature into IoSession like the following?
> >
> > // getLogger() returns SLF4J Logger. Category will be the FQCN of the
> > IoHandler.
> > session.getLogger().info(session, "message");
> > // Category can be overriden if requested.
> > session.getLogger(Main.class).info(session, "message 2");
> >
> > There won't be any performance difference IMO.
> >
> > I'm not sure it's a good idea to integrate with SLF4J tightly, so
> > please let me know what you think about it.
> >
> > Trustin
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >
>
>
>
> --
> 致敬
> 向秦贤
>
--
..Cheers
Mark
Re: Integrating SessionLog into IoSession
Posted by 向秦贤 <fy...@gmail.com>.
hi,
+1, change to session.getLogger();
About slf4j, No dout tighty.
If no use of slf4j, we must do another style log utility, and there are only
options.
So, go ahead courageously sister:) (topic song of movie <Red Sorghum >)
2007/7/27, Trustin Lee <tr...@gmail.com>:
>
> Hi community,
>
> Sorry for flooding idea, but I got some free time today. :)
>
> Currently, we log messages from IoHandler like the following:
>
> SessionLog.info(session, "message");
>
> What about integrating this feature into IoSession like the following?
>
> // getLogger() returns SLF4J Logger. Category will be the FQCN of the
> IoHandler.
> session.getLogger().info(session, "message");
> // Category can be overriden if requested.
> session.getLogger(Main.class).info(session, "message 2");
>
> There won't be any performance difference IMO.
>
> I'm not sure it's a good idea to integrate with SLF4J tightly, so
> please let me know what you think about it.
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
--
致敬
向秦贤