From 9192829e4d872dfcdb949fe4061eb19a9d7ee63d Mon Sep 17 00:00:00 2001 From: Simon Pepping Date: Thu, 5 Oct 2006 18:44:15 +0000 Subject: [PATCH] Create a class-specific logger for each LayoutManager which uses a logger. This includes the patch of bug 40667. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@453310 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/layoutmgr/AbstractBaseLayoutManager.java | 2 +- .../org/apache/fop/layoutmgr/AbstractLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/BlockContainerLayoutManager.java | 7 +++++++ src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/BlockStackingLayoutManager.java | 8 ++++++++ src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java | 5 +---- src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java | 7 +++++++ .../org/apache/fop/layoutmgr/PageBreakingAlgorithm.java | 3 +-- .../apache/fop/layoutmgr/StaticContentLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/inline/ContentLayoutManager.java | 8 ++++++++ .../fop/layoutmgr/inline/FootnoteLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/inline/InlineLayoutManager.java | 8 ++++++++ .../fop/layoutmgr/inline/LeafNodeLayoutManager.java | 8 ++++++++ .../apache/fop/layoutmgr/inline/LineLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/inline/TextLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/list/ListBlockLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/list/ListItemLayoutManager.java | 8 ++++++++ .../fop/layoutmgr/table/TableCellLayoutManager.java | 7 +++++++ .../apache/fop/layoutmgr/table/TableLayoutManager.java | 7 +++++++ 19 files changed, 120 insertions(+), 7 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java index 58e301c3f..da566ed91 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java @@ -44,7 +44,7 @@ public abstract class AbstractBaseLayoutManager /** * logging instance */ - protected static Log log = LogFactory.getLog(LayoutManager.class); + private static Log log = LogFactory.getLog(AbstractBaseLayoutManager.class); /** * Abstract base layout manager. diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index fbacba12d..8c7ac1cad 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.FObj; import org.apache.fop.fo.FONode; import org.apache.fop.area.Area; @@ -38,6 +40,11 @@ import java.util.Map; public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager implements Constants { + /** + * logging instance + */ + private static Log log = LogFactory.getLog(AbstractLayoutManager.class); + /** Parent LayoutManager for this LayoutManager */ protected LayoutManager parentLM = null; /** List of child LayoutManagers */ diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 127db160b..e99b966ef 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -25,6 +25,8 @@ import java.util.ListIterator; import java.awt.Point; import java.awt.geom.Rectangle2D; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.area.Area; import org.apache.fop.area.BlockViewport; import org.apache.fop.area.Block; @@ -43,6 +45,11 @@ import org.apache.fop.traits.SpaceVal; */ public class BlockContainerLayoutManager extends BlockStackingLayoutManager implements ConditionalElementListener { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(BlockContainerLayoutManager.class); private BlockViewport viewportBlockArea; private Block referenceArea; diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index 623c94c04..cf1cd4e4d 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -23,6 +23,8 @@ import java.util.LinkedList; import java.util.List; import java.util.ListIterator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.area.Area; import org.apache.fop.area.Block; import org.apache.fop.area.LineArea; @@ -39,6 +41,11 @@ import org.apache.fop.traits.SpaceVal; */ public class BlockLayoutManager extends BlockStackingLayoutManager implements ConditionalElementListener { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(BlockLayoutManager.class); private Block curBlockArea; diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index ea8f808ac..7b81ad478 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -24,6 +24,8 @@ import java.util.LinkedList; import java.util.List; import java.util.ListIterator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.area.Area; import org.apache.fop.area.BlockParent; import org.apache.fop.area.Block; @@ -40,6 +42,12 @@ import org.apache.fop.traits.MinOptMax; */ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager implements BlockLevelLayoutManager { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(BlockStackingLayoutManager.class); + /** * Reference to FO whose areas it's managing or to the traits * of the FO. diff --git a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java index 5720e3095..baa0013c3 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java @@ -42,10 +42,7 @@ import org.apache.fop.fo.FONode; public abstract class BreakingAlgorithm { /** the logger for the class */ - protected static Log classLog = LogFactory.getLog(BreakingAlgorithm.class); - - /** the logger for the instance */ - protected Log log = classLog; + protected static Log log = LogFactory.getLog(BreakingAlgorithm.class); /** Maximum adjustment ration */ protected static final int INFINITE_RATIO = 1000; diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index 96d564b7d..831423838 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.pagination.Flow; import org.apache.fop.layoutmgr.inline.InlineLevelLayoutManager; import org.apache.fop.area.Area; @@ -37,6 +39,11 @@ import java.util.ListIterator; */ public class FlowLayoutManager extends BlockStackingLayoutManager implements BlockLevelLayoutManager { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(FlowLayoutManager.class); /** Array of areas currently being filled stored by area class */ private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX]; diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index cb28223d0..cf12dffb9 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -35,7 +35,7 @@ import org.apache.fop.traits.MinOptMax; class PageBreakingAlgorithm extends BreakingAlgorithm { /** the logger for the class */ - protected static Log classLog = LogFactory.getLog(PageBreakingAlgorithm.class); + private static Log log = LogFactory.getLog(PageBreakingAlgorithm.class); private LayoutManager topLevelLM; private PageSequenceLayoutManager.PageProvider pageProvider; @@ -101,7 +101,6 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { boolean partOverflowRecovery, boolean autoHeight, boolean favorSinglePart) { super(alignment, alignmentLast, true, partOverflowRecovery, 0); - this.log = classLog; this.topLevelLM = topLevelLM; this.pageProvider = pageProvider; this.layoutListener = layoutListener; diff --git a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index e7ccc2b71..00bba8ae2 100644 --- a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -23,6 +23,8 @@ import java.util.LinkedList; import java.util.List; import java.util.ListIterator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.area.RegionReference; import org.apache.fop.area.Area; import org.apache.fop.area.Block; @@ -42,6 +44,11 @@ import org.apache.fop.traits.MinOptMax; */ public class StaticContentLayoutManager extends BlockStackingLayoutManager { + /** + * logging instance + */ + private static Log log = LogFactory.getLog(StaticContentLayoutManager.class); + private RegionReference targetRegion; private Block targetBlock; private SideRegion regionFO; diff --git a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java index 277e919e2..22796c8bc 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr.inline; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.Constants; import org.apache.fop.fo.pagination.Title; @@ -52,6 +54,12 @@ import org.apache.fop.area.Block; */ public class ContentLayoutManager extends AbstractBaseLayoutManager implements InlineLevelLayoutManager { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(ContentLayoutManager.class); + private FOUserAgent userAgent; private Area holder; private int stackSize; diff --git a/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java index c936a3729..91b7270eb 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java @@ -23,6 +23,8 @@ import java.util.LinkedList; import java.util.List; import java.util.ListIterator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.flow.Footnote; import org.apache.fop.layoutmgr.AbstractLayoutManager; import org.apache.fop.layoutmgr.FootnoteBodyLayoutManager; @@ -38,6 +40,11 @@ import org.apache.fop.layoutmgr.Position; public class FootnoteLayoutManager extends AbstractLayoutManager implements InlineLevelLayoutManager { + /** + * logging instance + */ + private static Log log = LogFactory.getLog(FootnoteLayoutManager.class); + private Footnote footnote; private InlineStackingLayoutManager citationLM; private FootnoteBodyLayoutManager bodyLM; diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java index d3d5868f2..ea6d1ceff 100755 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java @@ -23,6 +23,8 @@ import java.util.ListIterator; import java.util.LinkedList; import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.area.Area; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.inline.InlineBlockParent; @@ -56,6 +58,12 @@ import org.apache.fop.traits.SpaceVal; * such as Inline or Line */ public class InlineLayoutManager extends InlineStackingLayoutManager { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(InlineLayoutManager.class); + private InlineLevel fobj; private CommonMarginInline inlineProps = null; diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java index 74eeef2e5..20f8a0571 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java @@ -22,6 +22,8 @@ package org.apache.fop.layoutmgr.inline; import java.util.LinkedList; import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.area.Area; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.fo.FObj; @@ -48,6 +50,12 @@ import org.apache.fop.traits.MinOptMax; */ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager implements InlineLevelLayoutManager { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(LeafNodeLayoutManager.class); + /** * The inline area that this leafnode will add. */ diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index e7571fda0..f1dba6d93 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr.inline; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.Constants; @@ -74,6 +76,11 @@ import org.apache.fop.traits.MinOptMax; public class LineLayoutManager extends InlineStackingLayoutManager implements BlockLevelLayoutManager { + /** + * logging instance + */ + private static Log log = LogFactory.getLog(LineLayoutManager.class); + private Block fobj; private boolean isFirstInBlock; diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 35a298db3..bfacc777b 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -24,6 +24,8 @@ import java.util.List; import java.util.LinkedList; import java.util.ListIterator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.area.Trait; import org.apache.fop.area.inline.TextArea; import org.apache.fop.fo.Constants; @@ -101,6 +103,11 @@ public class TextLayoutManager extends LeafNodeLayoutManager { } } + /** + * logging instance + */ + private static Log log = LogFactory.getLog(TextLayoutManager.class); + // Hold all possible breaks for the text in this LM's FO. private ArrayList vecAreaInfo; diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java index 67e609662..b830f84de 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr.list; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.layoutmgr.BlockLevelLayoutManager; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; @@ -48,6 +50,11 @@ import java.util.List; public class ListBlockLayoutManager extends BlockStackingLayoutManager implements ConditionalElementListener { + /** + * logging instance + */ + private static Log log = LogFactory.getLog(ListBlockLayoutManager.class); + private Block curBlockArea; private boolean discardBorderBefore; diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 336d34f30..ffe356fe9 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr.list; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.flow.ListItem; import org.apache.fop.fo.flow.ListItemBody; import org.apache.fop.fo.flow.ListItemLabel; @@ -56,6 +58,12 @@ import java.util.ListIterator; */ public class ListItemLayoutManager extends BlockStackingLayoutManager implements ConditionalElementListener { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(ListItemLayoutManager.class); + private ListItemContentLayoutManager label; private ListItemContentLayoutManager body; diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java index 440a2a75e..8172edb50 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java @@ -21,6 +21,8 @@ package org.apache.fop.layoutmgr.table; import java.util.LinkedList; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableCell; @@ -48,6 +50,11 @@ import org.apache.fop.traits.MinOptMax; */ public class TableCellLayoutManager extends BlockStackingLayoutManager implements BlockLevelLayoutManager { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(TableCellLayoutManager.class); private PrimaryGridUnit gridUnit; diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 1df3f5b73..886af6a2c 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -19,6 +19,8 @@ package org.apache.fop.layoutmgr.table; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableFObj; @@ -56,6 +58,11 @@ import org.apache.fop.fo.FObj; */ public class TableLayoutManager extends BlockStackingLayoutManager implements ConditionalElementListener { + + /** + * logging instance + */ + private static Log log = LogFactory.getLog(TableLayoutManager.class); private TableContentLayoutManager contentLM; private ColumnSetup columns = null; -- 2.39.5