On Aug 3, 2007, at 8:26 PM, Karan Malhi wrote:

If the logger names could be extracted to constants in an interface,
then it will be easier to make changes to logger names and will also
lead to lesser errors , because logger names are case sensitive

So for example, instead of obtaining a logger like

    public static final Logger logger =
Logger.getInstance("OpenEJB.startup",
Assembler.class.getPackage().getName());

We could do something like

    public static final Logger logger =
Logger.getInstance(LogCategory.OPENEJB_STARTUP,
Assembler.class.getPackage().getName());

In fact, with static import it will just be

   public static final Logger logger =
Logger.getInstance(OPENEJB_STARTUP,
Assembler.class.getPackage().getName());

LogCategory would contain the names of all loggers used in openejb.
Since there are just a few loggers, they could be defined within the
Logger class itself.

Any thoughts on this one?

I really like the idea. We could javadoc the heck out of each category and then include the source file in a page on the website via the snippet plugin.

-David



On 8/1/07, Karan Malhi <[EMAIL PROTECTED]> wrote:
But I suppose if we had each logger return the formatted message it
could still be fine, such as:

         String msg = logger.fatal("config.noContainerFound",
d.getContainerId(), d.getEjbName());
         throw new OpenEJBException(msg);

This is a nice idea !! .

--
Karan Singh Malhi



--
Karan Singh Malhi


Reply via email to