Does that mean you put everything in one single class?

The question is because you just added a STATIC
  public static void log( final String message, LogLevel level )

...and no constructor with a Logger parameter and no inheritance
from a Logger. (You probably did it in a hurry so you could go 
back coding. (o:= )


I am just checking if that is the idea - merging the 2 classes 
in my post - which for me makes all the sense and is a nicer 
variation.


Have fun,
Paulo Gaspar

http://www.krankikom.de
http://www.ruhronline.de


> -----Original Message-----
> From: Peter Donald [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 10, 2002 11:56 PM
> To: Avalon Developers List
> Subject: Re: Divergence from Avalon (was Re: [RT] Is Poolable Harmful?)
> 
> 
> On Fri, 11 Jan 2002 01:51, Paulo Gaspar wrote:
> > Wouldn't an adapter class for such especial cases be adequate?
> > Something like (just a draft):
> 
> Similar to what I did. Except mine looked like
> > public class LogLevel extends ValuedEnum
> >     implements Serializable
> > {
> >     private final static Map m_levelMap = new HashMap(5);
> >
> >     public final static LogLevel DEBUG       = new 
> LogLevel("DEBUG",  5);
> >     public final static LogLevel INFO        = new 
> LogLevel("INFO",  10);
> >     public final static LogLevel WARN        = new 
> LogLevel("WARN",  15);
> >     public final static LogLevel ERROR       = new 
> LogLevel("ERROR", 20);
> >     public final static LogLevel FATAL_ERROR = new 
> LogLevel("FATAL_ERROR",
> > 25);
> >
>       public static void log( final String message, LogLevel level )
>       {
>        ...do if statement here...
>       }
> 
> >
> >     private LogLevel(final String i_name, final int i_value)
> >     {
> >         super(i_name, i_value, m_levelMap);
> >     }
> >
> >     public static LogLevel getLevelForName(final String i_levelName)
> >     {
> >         return (LogLevel)m_levelMap.get(i_levelName.toUpperCase());
> >     }
> >
> >     public String toString()
> >     {
> >         return "LogLevel[" + getName() + "/" + getValue() + "]";
> >     }
> >
> >     private Object readResolve()
> >         throws ObjectStreamException
> >     {
> >         return getLevelForName(getName());
> >     }
> > }
> 
> > This would allow to keep the current "clean" interface and
> > use this class just for those especial cases.
> >
> > What do you think?
> 
> Either way is good ;)
> 
> -- 
> Cheers,
> 
> Pete
> 
> ----------------------------------------
> "Liberty means responsibility. That is 
>       why most men dread it." - Locke
> ----------------------------------------
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to