Skip to content

Commit 9f6f0c0

Browse files
committed
Dont use logging mixin without debug enabled
1 parent 4618612 commit 9f6f0c0

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ziprofs.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def get(self, path: str) -> ZipFile:
7575
return self.cache[path][1]
7676

7777

78-
class ZipROFS(LoggingMixIn, Operations):
79-
MAX_SEEK_READ = 1 << 24
78+
class ZipROFS(Operations):
8079
zip_factory = CachedZipFactory()
8180

8281
def __init__(self, root):
@@ -88,7 +87,7 @@ def __init__(self, root):
8887
self._lock = RLock()
8988

9089
def __call__(self, op, path, *args):
91-
return super(ZipROFS, self).__call__(op, self.root + path, *args)
90+
return super().__call__(op, self.root + path, *args)
9291

9392
def _get_free_zip_fh(self):
9493
i = 5 # avoid confusion with stdin/err/out
@@ -234,6 +233,11 @@ def statfs(self, path):
234233
))
235234

236235

236+
class ZipROFSDebug(LoggingMixIn, ZipROFS):
237+
def __call__(self, op, path, *args):
238+
return super().__call__(op, self.root + path, *args)
239+
240+
237241
class fuse_conn_info(ctypes.Structure):
238242
_fields_ = [
239243
('proto_major', ctypes.c_uint),
@@ -306,8 +310,13 @@ def parse_mount_opts(in_str):
306310
logging.basicConfig(
307311
level=logging.DEBUG if 'debug' in arg.opts else logging.INFO)
308312

313+
if 'debug' in arg.opts:
314+
fs = ZipROFSDebug(arg.root)
315+
else:
316+
fs = ZipROFS(arg.root)
317+
309318
fuse = ZipROFuse(
310-
ZipROFS(arg.root),
319+
fs,
311320
arg.mountpoint,
312321
foreground=('foreground' in arg.opts),
313322
allow_other=('allowother' in arg.opts),

0 commit comments

Comments
 (0)