You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Michael Dick <mi...@gmail.com> on 2010/06/08 16:37:59 UTC

Re: [DISCUSS] localized trace messages

Resurrecting this thread.

Pinaki has recently advocated introducing a new debug logging level. Adding
a new level could be confusing - the difference between debug and trace is
not intuitively obvious. Before introducing a new construct I think we need
a compelling reason for localized trace.

Thus far the main justifications are: precedent (trace has always been
localized), and the existence of some trace messages which are user facing.

For the former I think there's sufficient sentiment that localizing trace is
overkill. For the latter I submit that such messages are really info or
warning messages (an example that proves me wrong might be good).

-mike

On Mon, Apr 12, 2010 at 9:34 AM, Donald Woods <dw...@apache.org> wrote:

> I have to agree with Mike and Rick, that TRACE messages are for us (the
> project developers) and not the end users.  That is the philosophy of
> all the other Apache projects I'm involved with (Geronimo and Bean
> Validation) and other projects we use in Geronimo (like Derby, OpenEJB,
> ActiveMQ and Axis2....)
>
> If we start providing translated trace messages, then we'll -
> 1) bloat the size of our jars
> 2) probably never have fully translated trace messages, as these change
> more often than Log messages
> 3) will complicate the diagnosis of reported problems, as we'll have to
> spend more of our time converting from the submitted locale to our own
>
> I'd have to vote -1 to providing translated TRACE messages.
>
>
> -Donald
>
>
> On 4/9/10 12:43 PM, Michael Dick wrote:
> > Hi Pinaki,
> >
> > That's a different definition of TRACE than I'm used to. I was under the
> > impression that trace *is* for developers. It's hard to find a consensus
> on
> > the Internet but I can point to this
> > definition<
> http://en.wikipedia.org/wiki/Tracing_%28software%29#Event_logging_versus_tracing
> >which
> > I think sums it up.
> >
> > If we do go with your definition of trace I'd argue that we need a new
> log
> > level which is for developers, not for users.
> >
> > -mike
> >
> > On Fri, Apr 9, 2010 at 11:26 AM, Pinaki Poddar <pp...@apache.org>
> wrote:
> >
> >>
> >> TRACE messages are *not* for the developer -- they are for the user
> (under
> >> duress and using them as the last resort to figure out a problem) and
> they
> >> must be localized.
> >>
> >> During development a developer may temporarily use whatever mechanics to
> >> suit his/her style -- but once the development is complete, then
> cleaning
> >> the workspace is part of the work process.
> >>
> >>
> >> -----
> >> Pinaki
> >> --
> >> View this message in context:
> >>
> http://n2.nabble.com/DISCUSS-localized-trace-messages-tp4877982p4878105.html
> >> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
> >>
> >
>

Re: [DISCUSS] localized trace messages

Posted by Patrick Linskey <pl...@gmail.com>.
>> Please note that there are huge number of localized trace messages exists
>> today. Someone must have been diligent enough to make that happen.
>> 
> 
> My guess is that all strings were arbitrarily localized at some point - just
> a guess though.

This is exactly right -- historically, we localized all strings from the get-go, and then evolved towards that being overkill. It doesn't seem worth it to retroactively de-localize things, though, so we've never moved back in that direction.

-Patrick

On Jun 8, 2010, at 12:33 PM, Michael Dick wrote:

> On Tue, Jun 8, 2010 at 11:30 AM, Pinaki Poddar <pp...@apache.org> wrote:
> 
>> 
>> 
>> TRACE = Debug by the user
>> DEBUG = Debug by the support/developer
>> 
>>> Mike wrote:
>>> I submit that such messages are really info or warning messages (an
>>> example that proves me wrong
>>> might be good).
>> 
>> The example use case for TRACE is seeing how mapping strategy is getting
>> decided or PCEnhancer working -- the monikers are familiar to the user
>> (because s/he had specified it) -- and s/he is looking at the trace to
>> decipher how the mapping annotations are being interpreted by OpenJPA (or
>> not). The data presented in those messages are informative from a user
>> point
>> of view and *does not* expose the internal data structures as much.
>> 
> 
> I disagree that such information is often of use to a user. Certainly most
> users are not concerned with how the PCEnhancer works, or _how_ a mapping
> strategy is decided. The result of these operations may be interesting. E.g.
> "OpenJPA cannot find a mapping strategy for field Foo.bar"  is interesting
> to users and should be an INFO / WARNING message. "OpenJPA is using the
> default mapping for field Foo.bar2 - no alternate mapping was specified" is
> not interesting and should be trace.
> 
> I don't really see these examples as being justification for localizing
> trace.
> 
> 
>> DEBUG messages, on the other hand, is a tool for support/development --
>> describes state of internal data structures if necessary (say state of a
>> bit
>> flag on when a flush is being called), no need to be localized/user
>> focused.
> 
> 
> 
> TRACE has traditionally been localized and thousands of localized trace
>> messages do exist in the code base is strong enough reason to retain that
>> behavior. Any other choice now will offer the weird output where
>> non-localized messages intermingle the localized messages.
>> 
> 
> 
>> If we feel a message is important enough to translate, then it should be
>>> using either the INFO or WARN level.
>> 
>> TRACE is not about importance of a message -- INFO is for that. TRACE is to
>> expose the inner operational logic/flow to the user as much as possible
>> without inundating with internal details.
> 
> 
>> It is just the use of localized message in TRACE are not consistent. I
>>> noticed that there are trace
>>> records that are localized and some are not
>> 
> 
>> That is more of an oversight -- I had never noticed a non-localized message
>> in OpenJPA till recently.
>> 
> 
> There are a few cases in 1.2.x which have been there for quite some time
> (2008). Haven't checked 2.0.x, but there might be more there.  One could
> argue that this indicates that localizing trace is a surprise to most
> contributors.
> 
> 
>> Please note that there are huge number of localized trace messages exists
>> today. Someone must have been diligent enough to make that happen.
>> 
> 
> My guess is that all strings were arbitrarily localized at some point - just
> a guess though.
> 
>> Historically, we made the following choices: 2. Don't bother localizing
>>> trace statements,
>> 
>> Not supported by code. See PCEnhancer.
>> 
>> -----
>> Pinaki
>> --
>> View this message in context:
>> http://openjpa.208410.n2.nabble.com/DISCUSS-localized-trace-messages-tp4877982p5154475.html
>> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>> 

-- 
Patrick Linskey
202 669 5907


Re: [DISCUSS] localized trace messages

Posted by Michael Dick <mi...@gmail.com>.
On Tue, Jun 8, 2010 at 11:30 AM, Pinaki Poddar <pp...@apache.org> wrote:

>
>
> TRACE = Debug by the user
> DEBUG = Debug by the support/developer
>
> > Mike wrote:
> >  I submit that such messages are really info or warning messages (an
> > example that proves me wrong
> >  might be good).
>
> The example use case for TRACE is seeing how mapping strategy is getting
> decided or PCEnhancer working -- the monikers are familiar to the user
> (because s/he had specified it) -- and s/he is looking at the trace to
> decipher how the mapping annotations are being interpreted by OpenJPA (or
> not). The data presented in those messages are informative from a user
> point
> of view and *does not* expose the internal data structures as much.
>

I disagree that such information is often of use to a user. Certainly most
users are not concerned with how the PCEnhancer works, or _how_ a mapping
strategy is decided. The result of these operations may be interesting. E.g.
"OpenJPA cannot find a mapping strategy for field Foo.bar"  is interesting
to users and should be an INFO / WARNING message. "OpenJPA is using the
default mapping for field Foo.bar2 - no alternate mapping was specified" is
not interesting and should be trace.

I don't really see these examples as being justification for localizing
trace.


> DEBUG messages, on the other hand, is a tool for support/development --
> describes state of internal data structures if necessary (say state of a
> bit
> flag on when a flush is being called), no need to be localized/user
> focused.



TRACE has traditionally been localized and thousands of localized trace
> messages do exist in the code base is strong enough reason to retain that
> behavior. Any other choice now will offer the weird output where
> non-localized messages intermingle the localized messages.
>


>  If we feel a message is important enough to translate, then it should be
> > using either the INFO or WARN level.
>
> TRACE is not about importance of a message -- INFO is for that. TRACE is to
> expose the inner operational logic/flow to the user as much as possible
> without inundating with internal details.


> It is just the use of localized message in TRACE are not consistent. I
> > noticed that there are trace
> > records that are localized and some are not
>

> That is more of an oversight -- I had never noticed a non-localized message
> in OpenJPA till recently.
>

There are a few cases in 1.2.x which have been there for quite some time
(2008). Haven't checked 2.0.x, but there might be more there.  One could
argue that this indicates that localizing trace is a surprise to most
contributors.


> Please note that there are huge number of localized trace messages exists
> today. Someone must have been diligent enough to make that happen.
>

My guess is that all strings were arbitrarily localized at some point - just
a guess though.

> Historically, we made the following choices: 2. Don't bother localizing
> > trace statements,
>
> Not supported by code. See PCEnhancer.
>
> -----
> Pinaki
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/DISCUSS-localized-trace-messages-tp4877982p5154475.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>

Re: [DISCUSS] localized trace messages

Posted by Michael Dick <mi...@gmail.com>.
+1

On Tue, Jun 8, 2010 at 11:42 AM, Donald Woods <dw...@apache.org> wrote:

>
>
> On 6/8/10 12:30 PM, Pinaki Poddar wrote:
> >
> >
> > TRACE = Debug by the user
> > DEBUG = Debug by the support/developer
> >
>
> If you follow the Log4J (and SLF4J) definitions and hierarchy, then
> TRACE is more detailed than DEBUG, with the increasing amount of logging
> being -
>
> ERROR
> WARN - includes ERROR
> INFO - includes WARN, ERROR
> DEBUG - includes INFO, WARN, ERROR
> TRACE - includes DEBUG, INFO, WARN, ERROR
>
> Thus, TRACE is used for internal OpenJPA "trace" messages, which should
> not be translated.
>
> If someone wants trace logging for Enhancer, then they should expect
> very low-level untranslated messages.
>
> Also, we have to be careful that TRACE level logging does not
> drastically slow down the code, otherwise it is useless, which having to
> load translated messages for every TRACE statement would surely do.
>
>
>
> >> Mike wrote:
> >>  I submit that such messages are really info or warning messages (an
> >> example that proves me wrong
> >>  might be good).
> >
> > The example use case for TRACE is seeing how mapping strategy is getting
> > decided or PCEnhancer working -- the monikers are familiar to the user
> > (because s/he had specified it) -- and s/he is looking at the trace to
> > decipher how the mapping annotations are being interpreted by OpenJPA (or
> > not). The data presented in those messages are informative from a user
> point
> > of view and *does not* expose the internal data structures as much.
> >
> > DEBUG messages, on the other hand, is a tool for support/development --
> > describes state of internal data structures if necessary (say state of a
> bit
> > flag on when a flush is being called), no need to be localized/user
> focused.
> >
> > TRACE has traditionally been localized and thousands of localized trace
> > messages do exist in the code base is strong enough reason to retain that
> > behavior. Any other choice now will offer the weird output where
> > non-localized messages intermingle the localized messages.
> >
> >>  If we feel a message is important enough to translate, then it should
> be
> >> using either the INFO or WARN level.
> >
> > TRACE is not about importance of a message -- INFO is for that. TRACE is
> to
> > expose the inner operational logic/flow to the user as much as possible
> > without inundating with internal details.
> >
> >
> >
> >> It is just the use of localized message in TRACE are not consistent. I
> >> noticed that there are trace
> >> records that are localized and some are not
> >
> > That is more of an oversight -- I had never noticed a non-localized
> message
> > in OpenJPA till recently.
> > Please note that there are huge number of localized trace messages exists
> > today. Someone must have been diligent enough to make that happen.
> >
> >> Historically, we made the following choices: 2. Don't bother localizing
> >> trace statements,
> >
> > Not supported by code. See PCEnhancer.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > -----
> > Pinaki
>

Re: [DISCUSS] localized trace messages

Posted by Donald Woods <dw...@apache.org>.

On 6/8/10 12:30 PM, Pinaki Poddar wrote:
> 
> 
> TRACE = Debug by the user
> DEBUG = Debug by the support/developer
>

If you follow the Log4J (and SLF4J) definitions and hierarchy, then
TRACE is more detailed than DEBUG, with the increasing amount of logging
being -

ERROR
WARN - includes ERROR
INFO - includes WARN, ERROR
DEBUG - includes INFO, WARN, ERROR
TRACE - includes DEBUG, INFO, WARN, ERROR

Thus, TRACE is used for internal OpenJPA "trace" messages, which should
not be translated.

If someone wants trace logging for Enhancer, then they should expect
very low-level untranslated messages.

Also, we have to be careful that TRACE level logging does not
drastically slow down the code, otherwise it is useless, which having to
load translated messages for every TRACE statement would surely do.



>> Mike wrote:
>>  I submit that such messages are really info or warning messages (an
>> example that proves me wrong 
>>  might be good). 
> 
> The example use case for TRACE is seeing how mapping strategy is getting
> decided or PCEnhancer working -- the monikers are familiar to the user
> (because s/he had specified it) -- and s/he is looking at the trace to
> decipher how the mapping annotations are being interpreted by OpenJPA (or
> not). The data presented in those messages are informative from a user point
> of view and *does not* expose the internal data structures as much.
> 
> DEBUG messages, on the other hand, is a tool for support/development --
> describes state of internal data structures if necessary (say state of a bit
> flag on when a flush is being called), no need to be localized/user focused.   
> 
> TRACE has traditionally been localized and thousands of localized trace
> messages do exist in the code base is strong enough reason to retain that
> behavior. Any other choice now will offer the weird output where
> non-localized messages intermingle the localized messages.
> 
>>  If we feel a message is important enough to translate, then it should be
>> using either the INFO or WARN level. 
> 
> TRACE is not about importance of a message -- INFO is for that. TRACE is to
> expose the inner operational logic/flow to the user as much as possible
> without inundating with internal details.
> 
> 
> 
>> It is just the use of localized message in TRACE are not consistent. I
>> noticed that there are trace 
>> records that are localized and some are not
> 
> That is more of an oversight -- I had never noticed a non-localized message
> in OpenJPA till recently.
> Please note that there are huge number of localized trace messages exists
> today. Someone must have been diligent enough to make that happen. 
> 
>> Historically, we made the following choices: 2. Don't bother localizing
>> trace statements,
> 
> Not supported by code. See PCEnhancer.
> 
>  
> 
> 
> 
> 
> 
>   
> 
> -----
> Pinaki 

Re: [DISCUSS] localized trace messages

Posted by Pinaki Poddar <pp...@apache.org>.

TRACE = Debug by the user
DEBUG = Debug by the support/developer

> Mike wrote:
>  I submit that such messages are really info or warning messages (an
> example that proves me wrong 
>  might be good). 

The example use case for TRACE is seeing how mapping strategy is getting
decided or PCEnhancer working -- the monikers are familiar to the user
(because s/he had specified it) -- and s/he is looking at the trace to
decipher how the mapping annotations are being interpreted by OpenJPA (or
not). The data presented in those messages are informative from a user point
of view and *does not* expose the internal data structures as much.

DEBUG messages, on the other hand, is a tool for support/development --
describes state of internal data structures if necessary (say state of a bit
flag on when a flush is being called), no need to be localized/user focused.   

TRACE has traditionally been localized and thousands of localized trace
messages do exist in the code base is strong enough reason to retain that
behavior. Any other choice now will offer the weird output where
non-localized messages intermingle the localized messages.

>  If we feel a message is important enough to translate, then it should be
> using either the INFO or WARN level. 

TRACE is not about importance of a message -- INFO is for that. TRACE is to
expose the inner operational logic/flow to the user as much as possible
without inundating with internal details.



> It is just the use of localized message in TRACE are not consistent. I
> noticed that there are trace 
> records that are localized and some are not

That is more of an oversight -- I had never noticed a non-localized message
in OpenJPA till recently.
Please note that there are huge number of localized trace messages exists
today. Someone must have been diligent enough to make that happen. 

> Historically, we made the following choices: 2. Don't bother localizing
> trace statements,

Not supported by code. See PCEnhancer.

 





  

-----
Pinaki 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/DISCUSS-localized-trace-messages-tp4877982p5154475.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Re: [DISCUSS] localized trace messages

Posted by Donald Woods <dw...@apache.org>.

On 6/8/10 10:37 AM, Michael Dick wrote:
> Resurrecting this thread.
> 
> Pinaki has recently advocated introducing a new debug logging level. Adding
> a new level could be confusing - the difference between debug and trace is
> not intuitively obvious. Before introducing a new construct I think we need
> a compelling reason for localized trace.
> 
> Thus far the main justifications are: precedent (trace has always been
> localized), and the existence of some trace messages which are user facing.
> 
> For the former I think there's sufficient sentiment that localizing trace is
> overkill. For the latter I submit that such messages are really info or
> warning messages (an example that proves me wrong might be good).
> 

Agree.  If we feel a message is important enough to translate, then it
should be using either the INFO or WARN level.


> -mike
> 
> On Mon, Apr 12, 2010 at 9:34 AM, Donald Woods <dw...@apache.org> wrote:
> 
>> I have to agree with Mike and Rick, that TRACE messages are for us (the
>> project developers) and not the end users.  That is the philosophy of
>> all the other Apache projects I'm involved with (Geronimo and Bean
>> Validation) and other projects we use in Geronimo (like Derby, OpenEJB,
>> ActiveMQ and Axis2....)
>>
>> If we start providing translated trace messages, then we'll -
>> 1) bloat the size of our jars
>> 2) probably never have fully translated trace messages, as these change
>> more often than Log messages
>> 3) will complicate the diagnosis of reported problems, as we'll have to
>> spend more of our time converting from the submitted locale to our own
>>
>> I'd have to vote -1 to providing translated TRACE messages.
>>
>>
>> -Donald
>>
>>
>> On 4/9/10 12:43 PM, Michael Dick wrote:
>>> Hi Pinaki,
>>>
>>> That's a different definition of TRACE than I'm used to. I was under the
>>> impression that trace *is* for developers. It's hard to find a consensus
>> on
>>> the Internet but I can point to this
>>> definition<
>> http://en.wikipedia.org/wiki/Tracing_%28software%29#Event_logging_versus_tracing
>>> which
>>> I think sums it up.
>>>
>>> If we do go with your definition of trace I'd argue that we need a new
>> log
>>> level which is for developers, not for users.
>>>
>>> -mike
>>>
>>> On Fri, Apr 9, 2010 at 11:26 AM, Pinaki Poddar <pp...@apache.org>
>> wrote:
>>>
>>>>
>>>> TRACE messages are *not* for the developer -- they are for the user
>> (under
>>>> duress and using them as the last resort to figure out a problem) and
>> they
>>>> must be localized.
>>>>
>>>> During development a developer may temporarily use whatever mechanics to
>>>> suit his/her style -- but once the development is complete, then
>> cleaning
>>>> the workspace is part of the work process.
>>>>
>>>>
>>>> -----
>>>> Pinaki
>>>> --
>>>> View this message in context:
>>>>
>> http://n2.nabble.com/DISCUSS-localized-trace-messages-tp4877982p4878105.html
>>>> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>>>>
>>>
>>
> 

Re: [DISCUSS] localized trace messages

Posted by Donald Woods <dw...@apache.org>.

On 6/8/10 11:19 AM, Patrick Linskey wrote:
> Historically, we made the following choices:
> 
> 1. Never emit debug-level messages, since developers often turn on all
> debug-level messages when debugging their own code. Since trace is
> finer-grained than debug, this gives developers an easy switch to show
> all their messages but not get inundated by OpenJPA's.
> 

Interesting distinction.  Maybe we should mention this on the wiki....


> 2. Don't bother localizing trace statements, as they're intended for
> consumption by support staff more than by end users. Of course, in the
> open-source realm, there is less of a clear distinction here.
> 
> -Patrick
> 

Re: [DISCUSS] localized trace messages

Posted by Patrick Linskey <pl...@gmail.com>.
Historically, we made the following choices:

1. Never emit debug-level messages, since developers often turn on all  
debug-level messages when debugging their own code. Since trace is  
finer-grained than debug, this gives developers an easy switch to show  
all their messages but not get inundated by OpenJPA's.

2. Don't bother localizing trace statements, as they're intended for  
consumption by support staff more than by end users. Of course, in the  
open-source realm, there is less of a clear distinction here.

-Patrick

-- 
Patrick Linskey
202 669 5907

On Jun 8, 2010, at 7:37, Michael Dick <mi...@gmail.com> wrote:

> Resurrecting this thread.
>
> Pinaki has recently advocated introducing a new debug logging level.  
> Adding
> a new level could be confusing - the difference between debug and  
> trace is
> not intuitively obvious. Before introducing a new construct I think  
> we need
> a compelling reason for localized trace.
>
> Thus far the main justifications are: precedent (trace has always been
> localized), and the existence of some trace messages which are user  
> facing.
>
> For the former I think there's sufficient sentiment that localizing  
> trace is
> overkill. For the latter I submit that such messages are really info  
> or
> warning messages (an example that proves me wrong might be good).
>
> -mike
>
> On Mon, Apr 12, 2010 at 9:34 AM, Donald Woods <dw...@apache.org>  
> wrote:
>
>> I have to agree with Mike and Rick, that TRACE messages are for us  
>> (the
>> project developers) and not the end users.  That is the philosophy of
>> all the other Apache projects I'm involved with (Geronimo and Bean
>> Validation) and other projects we use in Geronimo (like Derby,  
>> OpenEJB,
>> ActiveMQ and Axis2....)
>>
>> If we start providing translated trace messages, then we'll -
>> 1) bloat the size of our jars
>> 2) probably never have fully translated trace messages, as these  
>> change
>> more often than Log messages
>> 3) will complicate the diagnosis of reported problems, as we'll  
>> have to
>> spend more of our time converting from the submitted locale to our  
>> own
>>
>> I'd have to vote -1 to providing translated TRACE messages.
>>
>>
>> -Donald
>>
>>
>> On 4/9/10 12:43 PM, Michael Dick wrote:
>>> Hi Pinaki,
>>>
>>> That's a different definition of TRACE than I'm used to. I was  
>>> under the
>>> impression that trace *is* for developers. It's hard to find a  
>>> consensus
>> on
>>> the Internet but I can point to this
>>> definition<
>> http://en.wikipedia.org/wiki/Tracing_%28software%29#Event_logging_versus_tracing
>>> which
>>> I think sums it up.
>>>
>>> If we do go with your definition of trace I'd argue that we need a  
>>> new
>> log
>>> level which is for developers, not for users.
>>>
>>> -mike
>>>
>>> On Fri, Apr 9, 2010 at 11:26 AM, Pinaki Poddar <pp...@apache.org>
>> wrote:
>>>
>>>>
>>>> TRACE messages are *not* for the developer -- they are for the user
>> (under
>>>> duress and using them as the last resort to figure out a problem)  
>>>> and
>> they
>>>> must be localized.
>>>>
>>>> During development a developer may temporarily use whatever  
>>>> mechanics to
>>>> suit his/her style -- but once the development is complete, then
>> cleaning
>>>> the workspace is part of the work process.
>>>>
>>>>
>>>> -----
>>>> Pinaki
>>>> --
>>>> View this message in context:
>>>>
>> http://n2.nabble.com/DISCUSS-localized-trace-messages-tp4877982p4878105.html
>>>> Sent from the OpenJPA Developers mailing list archive at  
>>>> Nabble.com.
>>>>
>>>
>>