From 83ba67c4bfe9f9e48dbb1016a2410f51db7d12b3 Mon Sep 17 00:00:00 2001 From: Artem Baguinski Date: Fri, 18 Apr 2008 20:09:37 +0200 Subject: [PATCH] some output with debug --- records.py | 4 +++- shuffle.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/records.py b/records.py index 49a5a2d..48657fb 100644 --- a/records.py +++ b/records.py @@ -1,5 +1,7 @@ import struct, os, re +from logging import debug + BIG_ENDIAN = True LITTLE_ENDIAN = False @@ -99,7 +101,7 @@ class Field(BaseField): def read(self, file, dict): value = self.unpack( file.read( self.get_size() )) - print "read %s: %s" % (self, value) + debug("read %s: %s", self, value) self.put(dict, value) def write(self, file, dict): file.write( self.pack( self.get(dict) )) diff --git a/shuffle.py b/shuffle.py index c03faeb..369d17e 100644 --- a/shuffle.py +++ b/shuffle.py @@ -138,6 +138,9 @@ class ShuffleDB: ##################################################################### if __name__ == '__main__': + import logging + logging.basicConfig(level=logging.DEBUG,filename='shuffle-debug.log') + def print_list(xs): for x in xs: print x -- 2.11.4.GIT