diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-04-24 15:00:21 +0200 |
---|---|---|
committer | Marco Capitani <m.capitani@nextworks.it> | 2017-04-24 15:00:21 +0200 |
commit | eda14393d20cdd0b9ef9303f024f4c8a0b47eda2 (patch) | |
tree | d5fffe103ad8f39669147b69e59274b0e4731fe8 /tools | |
parent | bec81866d4da33405c35c8eb4dc15d4fc5bfbfb7 (diff) | |
download | rumba-eda14393d20cdd0b9ef9303f024f4c8a0b47eda2.tar.gz rumba-eda14393d20cdd0b9ef9303f024f4c8a0b47eda2.zip |
Logging: added set and reset logging level method, small logging modifications.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/democonf2rumba.py | 14 |
1 files changed, 12 insertions, 2 deletions
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.") |