From d3bd0c71cc6f8dfa6b7c93f19f9e605dfa438d81 Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Fri, 7 Aug 2009 15:39:05 -0700 Subject: Added some logging diff --git a/dump_chunkfile.py b/dump_chunkfile.py index 84fbfac..64b1af9 100755 --- a/dump_chunkfile.py +++ b/dump_chunkfile.py @@ -1,6 +1,13 @@ #!/usr/bin/env python -import FuseArchive.ChunkFile, sys, re, os +import FuseArchive.ChunkFile, sys, re, os, logging + +#log_level = logging.DEBUG +log_level = logging.WARNING +logging.basicConfig( level = log_level, + format = '%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(module)s:%(funcName)s() %(message)s', + stream = sys.stderr, + filemode = 'w' ) # Run this in the storage area, basically 'cat' the file file = re.sub( '^.*?tree', '', sys.argv[ 1 ] ) @@ -9,6 +16,7 @@ sys.stderr.write( "Opening file: %s\n" % file ) f = FuseArchive.ChunkFile.ChunkFile( file, os.O_RDONLY, 0 ) sys.stderr.write( "File is: %d bytes\n" % f.size ) +sys.stderr.write( "File has %d chunks\n" % len( f.chunks ) ) offset = 0 blocksize = 4096 -- cgit v0.10.2