Skip to content

Commit

Permalink
update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bmswens committed May 2, 2023
1 parent 7a7405f commit d8713bb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# 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 @@ -135,7 +133,7 @@ def onMessage(packet, interface, db_path=None):
timestamp = datetime.datetime.now()
rxTime = packet.get("rxTime")
if rxTime:
timestamp = datetime.datetime.fromtimestamp(packet["rxTime"])
timestamp = datetime.datetime.fromtimestamp(rxTime)
timestamp = timestamp.isoformat()
with Database(db_path) as db:
db.insert_message(uuid, sender, target, text, channel, timestamp)
Expand Down

0 comments on commit d8713bb

Please sign in to comment.