Skip to content

Commit

Permalink
added packet debug
Browse files Browse the repository at this point in the history
  • Loading branch information
bmswens committed May 2, 2023
1 parent 9c977e2 commit 7a7405f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import sqlite3
import datetime
import logging
import json

# 3rd party
import meshtastic.serial_interface
Expand All @@ -10,6 +12,8 @@
# custom
from api.mattermost import onMessage as mmOnMessage

# logging config
logging.basicConfig(filename='/app/data/packets.log', encoding='utf-8', level=logging.INFO)

def dict_factory(cursor, row):
fields = [column[0] for column in cursor.description]
Expand Down Expand Up @@ -122,6 +126,7 @@ def get_positions(self, node=None, limit=None):
def onMessage(packet, interface, db_path=None):
if not db_path: # pragma: no cover
db_path = get_db_path()
logging.info(json.dumps(packet))
uuid = packet["id"]
sender = packet["fromId"]
target = packet["toId"]
Expand Down

0 comments on commit 7a7405f

Please sign in to comment.