From 62c8f0fb40e1c2f2b39c37bdb24f823cda0e282d Mon Sep 17 00:00:00 2001 From: Ross Wilson Date: Sat, 23 Apr 2016 10:09:00 +0700 Subject: [PATCH] Adding debug logging --- pymlac/Display.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pymlac/Display.py b/pymlac/Display.py index ff3db8b..530a781 100644 --- a/pymlac/Display.py +++ b/pymlac/Display.py @@ -58,6 +58,8 @@ class Display(object): # 'dirty' flag set after writing self.dirty = False + log('Display: instance created') + def write(self): """Write display array to PPM file.""" @@ -75,6 +77,8 @@ class Display(object): handle.write('%d\n' % v) self.dirty = False + log('Display: array written to file %s' % filename) + def draw(self, x1, y1, x2, y2, dotted=False): """Draw a line on the screen. @@ -83,6 +87,8 @@ class Display(object): dotted True if dotted line, else False (IGNORED) """ + log('Display: drawing (%d,%d) to (%d,%d)' % (x1, y1, x2, y2)) + self.dirty = True # draw a straight line using Breshenam @@ -91,6 +97,8 @@ class Display(object): def clear(self): """Clear the display.""" + log('Display: clearing the display') + # write display to next PPM file first if self.dirty: self.write()