From bb796538fc53ac6a40fd12df7594b5550157619f Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Wed, 29 Jul 2009 10:55:04 -0700 Subject: Eliminated some more str() stuff diff --git a/fusearchive.py b/fusearchive.py index 26e4571..8e75ce1 100755 --- a/fusearchive.py +++ b/fusearchive.py @@ -24,7 +24,10 @@ fuse.fuse_python_api = (0, 2) fuse.feature_assert('stateful_files', 'has_init') -logging.basicConfig( level = logging.WARNING, +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' ) @@ -292,7 +295,7 @@ class FuseArchiveSerializer: @staticmethod def dumpfh( fh, obj ): - logging.debug( "Going to serialize %s to %s" % ( str( obj ), str( fh ) ) ) + logging.debug( "Going to serialize %s to %s" % ( obj, fh ) ) fh.truncate( 0 ) fh.seek( 0 ) f = gzip.GzipFile( None, "wb", gzip_compress_level, fh ) @@ -313,7 +316,7 @@ class FuseArchiveSerializer: @staticmethod def loadfh( fh ): - logging.debug( "Going to load from " + str( fh ) ) + logging.debug( "Going to load from %s" % fh ) fh.seek( 0 ) f = gzip.GzipFile( None, "rb", gzip_compress_level, fh ) #f = fh @@ -528,11 +531,11 @@ class FuseArchive(Fuse): if preexist: # Read in file info table - logging.debug( "Unpickling: " + str( self.file ) ) + logging.debug( "Unpickling: %s" % self.file ) # TODO: return an IO error if inflating fails try: magic = FuseArchiveSerializer.loadfh( self.file ) - logging.debug( "Got data: " + str( magic ) ) + logging.debug( "Got data: %s" % magic ) self.size = magic[ 'size' ] self.chunks = magic[ 'chunks' ] self.chunk_size = magic[ 'chunk_size' ] @@ -547,7 +550,7 @@ class FuseArchive(Fuse): self.direct_io = False self.keep_cache = False - logging.debug( str(self) + " init complete" ) + logging.debug( "%s init complete" % self ) def _load_chunk( self, index ): # If the current chunk is the same as the chunk we're loading -- cgit v0.10.2