From f3ef6666635bc89b0983abccdd45e7596ab67bc2 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 14 Feb 2016 16:13:16 +0100 Subject: add flag for requests debug logging --- fuse-httpfs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fuse-httpfs b/fuse-httpfs index aa68cf6..0963501 100755 --- a/fuse-httpfs +++ b/fuse-httpfs @@ -16,7 +16,10 @@ p.add_argument("--max_background", type=int, default=15, help="Maximum number of background threads") p.add_argument("--no_foreground", action="store_true", default=False, help="Fork into background as a daemon") -p.add_argument("--debug", action="store_true", help="Enable fuse debug") +p.add_argument("--debug", action="store_true", + help="Enable debug logging") +p.add_argument("--debug-requests", action="store_true", + help="Enable python-requests debug logging") p.add_argument("--nothreads", action="store_true", help="Disable fuse threads") p.add_argument("--timeout", type=float, default=None, @@ -37,8 +40,9 @@ if not args.pop("no_foreground"): kwargs["foreground"] = True if args.pop("debug"): kwargs["debug"] = True - print(httpfs.__name__) logging.getLogger(httpfs.__name__).setLevel(logging.DEBUG) +if args.pop("debug_requests"): + logging.getLogger("requests.packages.urllib3").setLevel(logging.DEBUG) kwargs.update(args) fuse = fuse.FUSE(httpfs.Httpfs(), httpfs.Config.mountpoint, **kwargs) -- cgit v1.2.1