diff --git a/swh/fuse/cli.py b/swh/fuse/cli.py --- a/swh/fuse/cli.py +++ b/swh/fuse/cli.py @@ -5,6 +5,7 @@ import asyncio from contextlib import ExitStack +import logging import os # WARNING: do not import unnecessary things here to keep cli startup time under @@ -114,7 +115,11 @@ from swh.fuse import fuse conf = config.read(config_file, DEFAULT_CONFIG) + # TODO: set default logging settings when --log-config is not passed + # DEFAULT_LOG_PATH = Path(".local/swh/fuse/mount.log") with ExitStack() as stack: if not foreground: - stack.enter_context(DaemonContext()) + # Do not close file handlers used for logging + file_handlers = [x.stream.fileno() for x in logging.root.handlers] + stack.enter_context(DaemonContext(files_preserve=file_handlers)) asyncio.run(fuse.main(swhids, path, conf))