Skip to content

Commit

Permalink
Call initLog() in Sniffer constructor (#5)
Browse files Browse the repository at this point in the history
Move call to initLog() to Sniffer constructor to make sure it is not
called when Sniffer module is imported.
  • Loading branch information
mkarhumaa authored Mar 2, 2022
1 parent 2c17e5e commit 19034c9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions SnifferAPI/Sniffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ def initLog():
logging.info("Software version: " + VERSION_STRING)


initLog()



import sys, os, threading
from . import SnifferCollector

Expand All @@ -65,6 +61,7 @@ class Sniffer(threading.Thread, SnifferCollector.SnifferCollector):
# the software will try to locate the firwmare automatically (may take time).
# NOTE: portnum is 0-indexed, while Windows names are 1-indexed
def __init__(self, portnum=None, baudrate=UART.SNIFFER_OLD_DEFAULT_BAUDRATE, **kwargs):
initLog()
threading.Thread.__init__(self)
SnifferCollector.SnifferCollector.__init__(self, portnum, baudrate=baudrate, **kwargs)
self.daemon = True
Expand Down

0 comments on commit 19034c9

Please sign in to comment.