diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2017-02-25 20:04:09 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2017-02-25 21:22:44 +0100 |
commit | de53538487244baa3e2f334edb3e55814f847ec8 (patch) | |
tree | a7e8f5d3236377add2dd548f98eef50636963f6e /glucometer.py | |
parent | fslibre: parse and output the scan and blood tests. (diff) | |
download | glucometerutils-de53538487244baa3e2f334edb3e55814f847ec8.tar glucometerutils-de53538487244baa3e2f334edb3e55814f847ec8.tar.gz glucometerutils-de53538487244baa3e2f334edb3e55814f847ec8.tar.bz2 glucometerutils-de53538487244baa3e2f334edb3e55814f847ec8.tar.lz glucometerutils-de53538487244baa3e2f334edb3e55814f847ec8.tar.xz glucometerutils-de53538487244baa3e2f334edb3e55814f847ec8.tar.zst glucometerutils-de53538487244baa3e2f334edb3e55814f847ec8.zip |
Diffstat (limited to 'glucometer.py')
-rwxr-xr-x | glucometer.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/glucometer.py b/glucometer.py index 3e6105b..be8fb02 100755 --- a/glucometer.py +++ b/glucometer.py @@ -9,6 +9,7 @@ __license__ = 'MIT' import argparse import importlib +import logging import sys from dateutil import parser as date_parser @@ -27,6 +28,11 @@ def main(): '--device', action='store', required=True, help='Select the path to the glucometer device.') + parser.add_argument( + '--vlog', action='store', required=False, type=int, + help=('Python logging level. See the levels at ' + 'https://docs.python.org/3/library/logging.html#logging-levels')) + subparsers.add_parser( 'info', help='Display information about the meter.') subparsers.add_parser( @@ -50,6 +56,8 @@ def main(): args = parser.parse_args() + logging.basicConfig(level=args.vlog) + driver = importlib.import_module('glucometerutils.drivers.' + args.driver) device = driver.Device(args.device) |