summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xglucometer.py8
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)