added a platypus logger
authorandy
Thu, 09 Jun 2005 22:07:02 +0000
changeset 2500 ea0e8cec358c
parent 2499 11bc8441ec51
child 2501 98a53df9b49e
added a platypus logger
reportlab/platypus/doctemplate.py
reportlab/platypus/frames.py
--- a/reportlab/platypus/doctemplate.py	Wed Jun 08 10:12:46 2005 +0000
+++ b/reportlab/platypus/doctemplate.py	Thu Jun 09 22:07:02 2005 +0000
@@ -36,6 +36,8 @@
 
 from types import *
 import sys
+import logging
+logger = logging.getLogger("reportlab.platypus")
 
 class LayoutError(Exception):
     pass
@@ -377,6 +379,7 @@
         '''Perform actions required at beginning of page.
         shouldn't normally be called directly'''
         self.page = self.page + 1
+        logger.debug("beginning page %d" % self.page)
         self.pageTemplate.beforeDrawPage(self.canv,self)
         self.pageTemplate.checkPageSize(self.canv,self)
         self.pageTemplate.onPage(self.canv,self)
@@ -412,6 +415,7 @@
             self.pageTemplate.afterDrawPage(self.canv, self)
             self.pageTemplate.onPageEnd(self.canv, self)
             self.afterPage()
+            logger.debug("ending page %d" % self.page)
             self.canv.setPageRotation(getattr(self.pageTemplate,'rotation',self.rotation))
             self.canv.showPage()
 
--- a/reportlab/platypus/frames.py	Wed Jun 08 10:12:46 2005 +0000
+++ b/reportlab/platypus/frames.py	Thu Jun 09 22:07:02 2005 +0000
@@ -7,6 +7,9 @@
 __doc__="""
 """
 
+import logging
+logger = logging.getLogger('reportlab.platypus')
+
 _geomAttr=('x1', 'y1', 'width', 'height', 'leftPadding', 'bottomPadding', 'rightPadding', 'topPadding')
 from reportlab import rl_config
 _FUZZ=rl_config._FUZZ
@@ -137,6 +140,7 @@
         else:
             #now we can draw it, and update the current point.
             flowable.drawOn(canv, self._x + self._leftExtraIndent, y, _sW=aW-w)
+            logger.debug('drew %s: \n    %s' % (flowable.__class__.__name__, flowable.identity()))
             s = flowable.getSpaceAfter()
             y -= s
             if self._oASpace: self._prevASpace = s
@@ -183,6 +187,7 @@
         frame is full.  If it cannot fit one object, raises
         an exception."""
 
+        logger.debug("enter Frame.addFromlist() for frame %s" % self.id)
         if self.showBoundary:
             self.drawBoundary(canv)