From 638e1b8b137e93bae46f8927fe4bf7d75721df64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 15 Apr 2017 18:06:21 +0100 Subject: fsoptium: use logging instead of writing to stderr directly. --- glucometerutils/drivers/fsoptium.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/glucometerutils/drivers/fsoptium.py b/glucometerutils/drivers/fsoptium.py index 92ee76d..2be063e 100644 --- a/glucometerutils/drivers/fsoptium.py +++ b/glucometerutils/drivers/fsoptium.py @@ -12,8 +12,8 @@ __copyright__ = 'Copyright © 2016-2017, Diego Elio Pettenò' __license__ = 'MIT' import datetime +import logging import re -import sys import serial @@ -254,8 +254,7 @@ class Device(object): raise exceptions.InvalidResponse(line) if match.group('type') != 'G': - print('Non-glucose readings are not supported, ignoring.', - file=sys.stderr) + logging.warning('Non-glucose readings are not supported, ignoring.') continue if match.group('reading') == 'HI ': -- cgit v1.2.3