Bob Lee wrote:
I thought we were talking about logging for Struts internals. Are we talking about also exposing a utility class of some sort to users? Or is this just
an example?
This is just an example.

Like I said in the other email, I'm all for varargs, but we should probably
just hard code it to j.u.logging and not worry about getting too fancy
and/or adding external deps.
Well, I don't think adding external deps was ever on the table as the discussion was prompted by wanting to get rid of them :) I'm fine with extending j.u.logging, but would plan to add isDebugEnabled and debug methods :)

Don


Bob

On 8/22/06, Don Brown <[EMAIL PROTECTED]> wrote:

I think a couple extra classes is worth switching from this:

public Order createOrder(User user, Product product, int quantity) {
    if ( log.isLoggable(Level.FINE) ) {
        log.fine("Creating new order for user: " + user.username() +
            " product: " + product.name()
            + " quantity: " + quantity);
    }
    return new Order(user, product, quantity);
}

to this:

public Order createOrder(User user, Product product, int quantity) {
log.debug("Creating new order for user: #0 product: #1 quantity: #2",
user.username(), product.name(), quantity);
    return new Order(user, product, quantity);
}


Considering how often we log things, I think the cleanup is huge and a
few classes are definitely worth the price.

Don

Bob Lee wrote:
> On 8/22/06, Don Brown <[EMAIL PROTECTED]> wrote:
>>
>> Well, for one, we only really need one logging instance for the whole
>> library.  Second, and admittedly this is subjective, the
>> java.util.logging API is a horribly designed, obtuse API.  I'd rather
>> see us write a small, clean API along the lines of Seam's logging class
>> that utilizes varargs to reduce the need for isDebugEnabled().
>
>
> I agree that j.u.logging is a PoS, but it's ubiquitous, and for our
> purposes, it workds fine. We may only need one logger for the whole
> framework, but it's just as easy to create a logger per class, and you
> can
> still configure them all at once. I'd rather fix j.u.logging than
> build yet
> another API.
>
> Bob
>


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





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

Reply via email to