diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-04-24 14:44:35 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-04-24 14:44:35 +0000 |
commit | a2a031857a0ea60e63a0e36ed9b429ef5ae0cdff (patch) | |
tree | 39f89b4f949fca88724e10e2ab00ddc230effa72 /tools | |
parent | b59e143880f910e9d504a190407f69ed2ffbc72a (diff) | |
parent | 58b1a46bfbf7960336fa25a3a9c3b8916530328f (diff) | |
download | rumba-a2a031857a0ea60e63a0e36ed9b429ef5ae0cdff.tar.gz rumba-a2a031857a0ea60e63a0e36ed9b429ef5ae0cdff.zip |
Merge branch 'logging-levels' into 'master'
Logging: added set and reset logging level method, small logging modifications.
See merge request !40
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.") |