X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02-2.git/blobdiff_plain/b17f34b42aa5e6ca959d8f3d748012c87d4d8999..df20089d0d749ef7cccc25f4567203a010e31e8d:/examples/gas.py?ds=sidebyside diff --git a/examples/gas.py b/examples/gas.py index faf6eac..2f84944 100755 --- a/examples/gas.py +++ b/examples/gas.py @@ -2,8 +2,14 @@ import time from enviroplus import gas +import logging -print("""gas.py - Print readings from the MICS6814 Gas sensor. +logging.basicConfig( + format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s', + level=logging.INFO, + datefmt='%Y-%m-%d %H:%M:%S') + +logging.info("""gas.py - Print readings from the MICS6814 Gas sensor. Press Ctrl+C to exit! @@ -12,7 +18,7 @@ Press Ctrl+C to exit! try: while True: readings = gas.read_all() - print(readings) + logging.info(readings) time.sleep(1.0) except KeyboardInterrupt: pass