aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_hwd.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-14 22:27:14 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:05 -0800
commiteccd185efb6b250cd6aa1f3f96b4c43d24cf4eb0 (patch)
tree6bd813a916845692abab494c6169d8d28fa89948 /mpm/python/usrp_hwd.py
parent4ca0e123a37e2a4cef44a142ebee02626297e9fe (diff)
downloaduhd-eccd185efb6b250cd6aa1f3f96b4c43d24cf4eb0.tar.gz
uhd-eccd185efb6b250cd6aa1f3f96b4c43d24cf4eb0.tar.bz2
uhd-eccd185efb6b250cd6aa1f3f96b4c43d24cf4eb0.zip
mpm: Add configurable log levels
Diffstat (limited to 'mpm/python/usrp_hwd.py')
-rwxr-xr-xmpm/python/usrp_hwd.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/mpm/python/usrp_hwd.py b/mpm/python/usrp_hwd.py
index 90f865da0..4149ff40d 100755
--- a/mpm/python/usrp_hwd.py
+++ b/mpm/python/usrp_hwd.py
@@ -63,6 +63,20 @@ def setup_arg_parser():
"used as defaults for device initialization.",
default=None
)
+ parser.add_argument(
+ '-v',
+ '--verbose',
+ help="Increase verbosity level",
+ action="count",
+ default=0
+ )
+ parser.add_argument(
+ '-q',
+ '--quiet',
+ help="Decrease verbosity level",
+ action="count",
+ default=0
+ )
return parser
def parse_args():
@@ -100,7 +114,6 @@ def kill_time(sig, frame):
proc.join()
except BlockingSwitchOutError:
log.debug("Caught BlockingSwitchOutError for {}".format(str(proc)))
- pass
log.info("System exiting")
sys.exit(0)
@@ -111,8 +124,10 @@ def main():
Main process loop.
"""
- log = mpm.get_main_logger().getChild('main')
args = parse_args()
+ log = mpm.get_main_logger(
+ log_default_delta=args.verbose-args.quiet
+ ).getChild('main')
shared = SharedState()
# Create the periph_manager for this device
# This call will be forwarded to the device specific implementation