Added debug option
diff --git a/cfg_checker/cfg_check.py b/cfg_checker/cfg_check.py
index 78436d6..b2e3886 100644
--- a/cfg_checker/cfg_check.py
+++ b/cfg_checker/cfg_check.py
@@ -1,6 +1,7 @@
import argparse
import os
import sys
+from logging import INFO, DEBUG
import reporter
from cfg_checker.common import utils, const
@@ -19,7 +20,6 @@
self.print_help()
-
def help_message():
print"""
Please, use following examples to generate info reports:\n
@@ -61,6 +61,12 @@
def config_check_entrypoint():
# Main entrypointр
parser = MyParser(prog="Cloud configuration checker")
+ parser.add_argument(
+ "-d",
+ "--debug",
+ action="store_true", default=False,
+ help="Set CLI logging level to DEBUG"
+ )
subparsers = parser.add_subparsers(dest='command')
# packages
pkg_parser = subparsers.add_parser(
@@ -107,6 +113,12 @@
#parse arguments
args = parser.parse_args()
+ # Handle options
+ if args.debug:
+ logger_cli.setLevel(DEBUG)
+ else:
+ logger_cli.setLevel(INFO)
+
# Execute the command
result = args.func(args)