From a6736d85a390d3724a7e8795acc2f29075d4648b Mon Sep 17 00:00:00 2001 From: Jeppe Fihl-Pearson Date: Sat, 9 Dec 2023 20:30:07 +0000 Subject: [PATCH] Add `--debug` flag to enable debug logging, otherwise default to info level Most users probably don't care about all the work to initiate connections and closing them again. This makes the output cleaner and could work as a good step towards refining the output from the utility. --- LGTV/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LGTV/__init__.py b/LGTV/__init__.py index 2a8b46b..169fbc1 100644 --- a/LGTV/__init__.py +++ b/LGTV/__init__.py @@ -107,9 +107,10 @@ def main(): parser.add_argument('command') parser.add_argument('args', nargs='*') parser.add_argument('--ssl', action='store_true') + parser.add_argument('--debug', '-d', action='store_true', help='enable debug output') args = parser.parse_args() - logging.basicConfig(level=logging.DEBUG) + logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO) config = {}