openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <dwo...@apache.org>
Subject Re: [DISCUSS] localized trace messages
Date Tue, 08 Jun 2010 16:42:35 GMT


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 

Mime
View raw message