From 355eb681da987593cc8d65ea6b0f306d3160bf77 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Nov 2016 08:30:11 +0100 Subject: [PATCH] Add debug printing --- python/jpmeijers.py | 8 ++++++-- python/lorautil.py | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python/jpmeijers.py b/python/jpmeijers.py index 0c43e3f..bc66946 100644 --- a/python/jpmeijers.py +++ b/python/jpmeijers.py @@ -12,8 +12,6 @@ import lorautil import logging import sys -log = logging.getLogger(__name__) -log.setLevel(logging.DEBUG) known_devices = [ "0004A30B001C6613" ] @@ -41,6 +39,8 @@ def get_gps(deveui, payload): text = ":lat={lat:.6f} lon={lon:.6f} alt={alt:.6f} acc={acc:.2f}".format(**values) res = [ deveui + text ] + log.debug("ttn mapper: {}".format(res[0])) + return res def decode(pkg): @@ -68,6 +68,10 @@ def nodered(provider, data): lorautil.nodered_send(provider, d) if __name__ == '__main__': + logging.basicConfig(format='%(levelname)s: %(message)s') + log = logging.getLogger(__name__) + log.setLevel(logging.DEBUG) + conns = lorautil.pg_conn_notify() while True: diff --git a/python/lorautil.py b/python/lorautil.py index ab16019..08916b4 100644 --- a/python/lorautil.py +++ b/python/lorautil.py @@ -20,7 +20,6 @@ log = logging.getLogger(__name__) dbname="lorawan" - def db_notify(provider, payload='', deveui=''): notify="{}:{}".format(deveui, payload) log.debug("Notify: {} {}".format(provider, notify))