diff options
author | 2018-08-21 10:31:47 +0200 | |
---|---|---|
committer | 2018-08-21 10:31:47 +0200 | |
commit | c85493b547d63404ec4c3280b2404b13b92892d0 (patch) | |
tree | e55fb750d86c66dac8339197c0c9096eba61bc53 /examples/ncclient/get_config.py | |
parent | c7425cb71413ed8f60493e2603ec9376137eadc2 (diff) |
examples: add verbose option to ncclient scripts
Change-Id: I42f1efed55072ec9885dda2a9dcd3c8d85980d8f
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'examples/ncclient/get_config.py')
-rwxr-xr-x | examples/ncclient/get_config.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/ncclient/get_config.py b/examples/ncclient/get_config.py index 5fdb6da3a..53b6854d6 100755 --- a/examples/ncclient/get_config.py +++ b/examples/ncclient/get_config.py @@ -31,9 +31,15 @@ def _get_config(reply_filename=None, host='localhost', port=2831, username='admi if __name__ == '__main__': - logger = logging.getLogger("hc2vpp.examples.get_config") - logging.basicConfig(level=logging.WARNING) argparser = argparse.ArgumentParser(description="Obtains VPP configuration using <get-config> RPC") argparser.add_argument('--reply_filename', help="name of XML file to store received configuration") + argparser.add_argument('--verbose', help="increase output verbosity", action="store_true") args = argparser.parse_args() + + logger = logging.getLogger("hc2vpp.examples.get_config") + if args.verbose: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.WARNING) + _get_config(args.reply_filename) |