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,20 @@ 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: + # TODO: temporary fix until swh.core has the proper logging utilities + # Disable logging config before daemonizing, and reset it once + # daemonized to be sure to not close file handlers + logging.shutdown() stack.enter_context(DaemonContext()) + logging.basicConfig( + handlers=[logging.handlers.SysLogHandler(address="/dev/log")], + level=logging.INFO, + # Necessary to overwrite swh.core.cli default values + force=True, + ) + asyncio.run(fuse.main(swhids, path, conf))