Loggers

2007-01-11 Thread richardw

In FONode, it say:

//TODO Remove getLogger() method!

Yet everywhere around the code base it says foo.getLogger(),
in particular for FObj instances. What is the preferred way
to aquire a logger instance?

Richard



Re: Loggers

2007-01-11 Thread Andreas L Delmelle

On Jan 11, 2007, at 13:41, [EMAIL PROTECTED] wrote:



In FONode, it say:

//TODO Remove getLogger() method!

Yet everywhere around the code base it says foo.getLogger(),
in particular for FObj instances. What is the preferred way
to aquire a logger instance?


log is a protected static, so if the class resides in the same  
package, then you can use direct member access. Currently, in some  
places, the properties seem to be routing the message to the FO's  
logger, instead of using Property.log directly... and now that you  
mention it, what strikes me as utterly absurd are the occurrences  
where getLogger() is used *to access the FObj logger from within an  
FObj*! 8-O ... Let me re-phrase: use an instance method to access a  
protected static member of the superclass. That's a good one! :-)
Well, who knows, maybe today's JVMs do inline instance methods if  
called by the instance itself. ;-)


Don't worry, already cleaning up.


Cheers,

Andreas



Re: Loggers

2007-01-11 Thread Andreas L Delmelle

On Jan 11, 2007, at 18:31, Andreas L Delmelle wrote:

... use an instance method to access a protected static member of  
the superclass. That's a good one! :-)


And what about:

if (log.isDebugEnabled()) {  getLogger().debug("..."); }

unless we were thinking about tying the settings for the static  
logger to a possible instance-based logger (if debug enabled on the  
static logger, then route message to instance logger?) Hmm...



Cheers,

Andreas


Re: Loggers

2007-01-11 Thread richardw
Andreas L Delmelle writes:
 > log is a protected static, so if the class resides in the same  
 > package, then you can use direct member access. Currently, in some  
 > places, the properties seem to be routing the message to the FO's  
 > logger, instead of using Property.log directly...

Or even worse - keeeping a reference to the FObj in question as a
member for the sole purpose of being able to call the getLogger()
method later on  - see LengthBase for example.

 > Well, who knows, maybe today's JVMs do inline instance methods if  
 > called by the instance itself. ;-)

Listening to what Neal Gafter had to say at Javapolis, the current
JVMs are doing a lot of clever optimizations. I'd expect something
as trivial as this to be covered in a lot of cases - but it's still
stupid design.

 > Don't worry, already cleaning up.

OK. When your changes are submitted and checked in, I'll update my
tree and submit a new patch for the properties fixes. The TXTHandler
looks to have been pretty badly broken by my fixes but everything
else should remain fine,

Regards,

Richard



Re: Loggers

2007-01-11 Thread Andreas L Delmelle

On Jan 11, 2007, at 19:51, [EMAIL PROTECTED] wrote:


Andreas L Delmelle writes:

log is a protected static, so if the class resides in the same
package, then you can use direct member access. Currently, in some
places, the properties seem to be routing the message to the FO's
logger, instead of using Property.log directly...


Or even worse - keeeping a reference to the FObj in question as a
member for the sole purpose of being able to call the getLogger()
method later on  - see LengthBase for example.


Not entirely true, I'm afraid. The fobj is also used to pass into  
PercentBaseContext.getBaseLength()... so FTM, I only replaced the  
call to getLogger() with logging to a specific logger for LengthBase.



Don't worry, already cleaning up.


OK. When your changes are submitted and checked in, I'll update my
tree and submit a new patch for the properties fixes.


Done, see: http://svn.apache.org/viewvc?view=rev&rev=495371

Thanks for pointing this out!

Cheers,

Andreas


DO NOT REPLY [Bug 40667] - Change protected Loggers to private

2006-10-03 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40667





--- Additional Comments From [EMAIL PROTECTED]  2006-10-03 07:03 ---
Created an attachment (id=18956)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18956&action=view)
Corrects Logger in several LM classes

Corrects (adds where missed) Logger from protected to private in these classes:

LineLayoutManager, TableCellLayoutManager, TableLayoutManager,
BreakingAlgorithm, PageBreakingAlgorithm

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.


DO NOT REPLY [Bug 40667] - Change protected Loggers to private

2006-10-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40667





--- Additional Comments From [EMAIL PROTECTED]  2006-10-04 12:15 ---
Andrejus,

Thanks for your patch. I have a few comments.

1. Your patch for src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
reads:

 /** the logger for the class */
 protected static Log classLog = 
LogFactory.getLog(PageBreakingAlgorithm.class);
 
+/** the logger for the instance */
+private static Log log = classLog;

Why don't you remove 'protected static Log classLog'?

Re the comment, a static variable is for the class, not for the instance.

2. In the LayoutManagers, there is a protected static Log instance in
org.apache.fop.layoutmgr.AbstractBaseLayoutManager, assigned to class 
LayoutManager:

protected static Log log = LogFactory.getLog(LayoutManager.class)

This is used by all LayoutManagers. I can imagine that you find this too coarse,
and prefer to see a different logger for each LayoutManager, but then it would
be better to do so for each LayoutManager.

Regards, Simon


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.


DO NOT REPLY [Bug 40667] - Change protected Loggers to private

2006-10-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40667>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40667





--- Additional Comments From [EMAIL PROTECTED]  2006-10-04 12:24 ---
Hi Simon,

I prefer to touch others code in very kind matter, meaning that I'd like to 
see as small recompiling as possible (in this case I wanted to touch just log 
members and not classLog I had no knowledge about). Yes, there is next step to 
do to change all other protected Loggers for LMs, but for me it would be much 
easier to to if we would deal with code tagging/modules/SVN branches instead 
of direct text patches. Right now I've applied Patrick's patch and to change 
other Loggers to private as well I would need once again to checkout whole 
source tree to another project and make those changes there. Actually I've 
planned finish that after I'll get some understanding of Patrick's code as 
well as with LMs invocations.

Sorry if it seems incomplete for you right now, but I've tried to make code 
after changes to be compilable.

Andrejus

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.


DO NOT REPLY [Bug 40667] - Change protected Loggers to private

2006-10-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40667>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40667





--- Additional Comments From [EMAIL PROTECTED]  2006-10-04 12:33 ---
(In reply to comment #3)

> members and not classLog I had no knowledge about). Yes, there is next step 
> to 
> do to change all other protected Loggers for LMs, but for me it would be much 
> easier to to if we would deal with code tagging/modules/SVN branches instead 
> of direct text patches. Right now I've applied Patrick's patch and to change 

Indeed, doing this by patches is bothersome. But as it is, the patch is a bit
small and random. I would prefer it if you would make the required changes in
your working copy and submit them in a patch which contains more work.

Of course, I could make the changes to the LM tree myself. What do the FOP
committers think: Give each LM its own logger? It will provide more clarity
during debugging, but it will also increase the number of loggers considerably.

Simon


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.


DO NOT REPLY [Bug 40667] - Change protected Loggers to private

2006-10-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40667>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40667





--- Additional Comments From [EMAIL PROTECTED]  2006-10-04 14:13 ---
(In reply to comment #4)
> Of course, I could make the changes to the LM tree myself. What do the FOP
> committers think: Give each LM its own logger? It will provide more clarity
> during debugging, but it will also increase the number of loggers 
> considerably.

+1 from me. It bugs me every now and then but so far I've never had enough
energy to actually do something about it. I only changed something for the
breaking algorithm where it was essential for me to keep line break stuff apart
from page break stuff while debugging.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.


DO NOT REPLY [Bug 40667] - Change protected Loggers to private

2006-10-05 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40667


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2006-10-05 11:46 ---
Patch extended to all LMs which use a logger and applied. Andrejus, thanks for
your patch.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.


DO NOT REPLY [Bug 40667] Change protected Loggers to private

2012-03-31 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=40667

Glenn Adams  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

--- Comment #7 from Glenn Adams  2012-04-01 06:39:29 UTC ---
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 40667] New: - Change protected Loggers to private

2006-10-03 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40667>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40667

   Summary: Change protected Loggers to private
   Product: Fop
   Version: 0.92
  Platform: PC
OS/Version: other
Status: NEW
  Severity: normal
  Priority: P2
 Component: general
AssignedTo: fop-dev@xmlgraphics.apache.org
ReportedBy: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]


 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.