You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Jon Scott Stevens <jo...@latchkey.com> on 2002/02/13 22:52:38 UTC
Re: cvs commit:
jakarta-commons/logging/src/java/org/apache/commons/logging/impl
LogFactoryImpl.java
on 2/12/02 6:18 PM, "craigmcc@apache.org" <cr...@apache.org> wrote:
> Log log = LogFactory.newFactory().getInstance("foo");
Why not have:
public class LogFactory
{
public Log getInstance(String foo)
{
return newFactory().getInstance(foo);
}
}
Then all you need to do is:
Log log = LogFactory.getInstance("foo");
Seems cleaner 2 me.
-jon
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: cvs commit:jakarta-commons/logging/src/java/org/apache/commons/logging/implLogFactoryImpl.java
Posted by co...@covalent.net.
On Thu, 14 Feb 2002, Paulo Gaspar wrote:
> What about multiple logging hierarchies?
I think the best solution is to add an explicit 'guard' or 'domain' to the
API.
We don't have to do it now - but we must make sure it is clear that
getInstance() _should_ return a local logger in a container env -
so 2 different applications using the same name for a logger will
not get mixed up.
Using the thread class loader as the default 'domain' ( in case
getInstance( name ) is called ) is reasonable, given that most
containers will use that, and that the factory/logger discovery
is dependent on the class loader.
In a future version ( or in this one ? ) we can add the explicit
getInstance( Object domain, String name ), and different apps will
be able to share a Log ( assuming they have access to a common
guard object ).
Costin
>
> Have fun,
> Paulo Gaspar
>
> > -----Original Message-----
> > From: Jon Scott Stevens [mailto:jon@latchkey.com]
> > Sent: Wednesday, February 13, 2002 11:40 PM
> > To: Jakarta Commons Developers List
> > Subject: Re: cvs
> > commit:jakarta-commons/logging/src/java/org/apache/commons/logging/implL
> > ogFactoryImpl.java
> >
> >
> > on 2/13/02 1:52 PM, "Jon Scott Stevens" <jo...@latchkey.com> wrote:
> >
> > > public Log getInstance(String foo)
> >
> > Sorry, that should be:
> >
> > public static Log getInstance(String foo)
> >
> > But you get my point...
> >
> > -jon
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: cvs commit:jakarta-commons/logging/src/java/org/apache/commons/logging/implLogFactoryImpl.java
Posted by Paulo Gaspar <pa...@krankikom.de>.
What about multiple logging hierarchies?
Have fun,
Paulo Gaspar
> -----Original Message-----
> From: Jon Scott Stevens [mailto:jon@latchkey.com]
> Sent: Wednesday, February 13, 2002 11:40 PM
> To: Jakarta Commons Developers List
> Subject: Re: cvs
> commit:jakarta-commons/logging/src/java/org/apache/commons/logging/implL
> ogFactoryImpl.java
>
>
> on 2/13/02 1:52 PM, "Jon Scott Stevens" <jo...@latchkey.com> wrote:
>
> > public Log getInstance(String foo)
>
> Sorry, that should be:
>
> public static Log getInstance(String foo)
>
> But you get my point...
>
> -jon
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: cvs commit:
jakarta-commons/logging/src/java/org/apache/commons/logging/impl
LogFactoryImpl.java
Posted by Jon Scott Stevens <jo...@latchkey.com>.
on 2/13/02 1:52 PM, "Jon Scott Stevens" <jo...@latchkey.com> wrote:
> public Log getInstance(String foo)
Sorry, that should be:
public static Log getInstance(String foo)
But you get my point...
-jon
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>