From eda14393d20cdd0b9ef9303f024f4c8a0b47eda2 Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Mon, 24 Apr 2017 15:00:21 +0200 Subject: Logging: added set and reset logging level method, small logging modifications. --- tools/democonf2rumba.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/democonf2rumba.py b/tools/democonf2rumba.py index 9d909c7..a73d6b7 100755 --- a/tools/democonf2rumba.py +++ b/tools/democonf2rumba.py @@ -4,10 +4,11 @@ import argparse import re import rumba.model as mod +import rumba.log as log def make_experiment(filename, experiment_class, experiment_kwargs, - testbed_class, testbed_kwargs): + testbed_class, testbed_kwargs, verbosity): """ :type filename str :param filename: path to the .conf file @@ -118,6 +119,8 @@ def make_experiment(filename, experiment_class, experiment_kwargs, .items()} parsed_nodes.append(mod.Node(name, difs, dif_registrations)) + log.set_logging_level(verbosity) + testbed = testbed_class(**testbed_kwargs) experiment_kwargs['testbed'] = testbed @@ -161,6 +164,12 @@ if __name__ == '__main__': required=True, help='Path to the config file to parse') + parser.add_argument( + '--verbosity', metavar='VERBOSITY', type=str, + default='INFO', + choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], + help='Path to the config file to parse') + subparsers = parser.add_subparsers(dest='testbed') emulab_p = subparsers.add_parser('emulab', help='Use emulab testbed') jfed_p = subparsers.add_parser('jfed', help='Use jfed testbed') @@ -254,7 +263,8 @@ if __name__ == '__main__': experiment_class=exp_class, experiment_kwargs={}, testbed_class=test_class, - testbed_kwargs=testbed_args) + testbed_kwargs=testbed_args, + verbosity=args.verbosity) except KeyboardInterrupt: print("Interrupted. Closing down.") -- cgit v1.2.3