Implemented logging class as logger
This commit is contained in:
parent
edfbe4e6c3
commit
bb71209da5
1 changed files with 3 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
from sensor.tofsensor import ToFSensor, Directions
|
||||
from datetime import datetime
|
||||
import logging
|
||||
|
||||
|
||||
COUNTING_CB = "counting"
|
||||
|
@ -35,9 +36,7 @@ class PeopleCounter ():
|
|||
while self.keepRunning:
|
||||
# Switch to other direction
|
||||
direction: Directions = Directions.other(direction)
|
||||
print("-" * 20)
|
||||
print("Direction:",direction)
|
||||
print("At time",datetime.now())
|
||||
logging.debug(f'Direction [{direction}] at {datetime.now()}')
|
||||
|
||||
self.sensor.setDirection(direction)
|
||||
|
||||
|
@ -48,7 +47,7 @@ class PeopleCounter ():
|
|||
if changed:
|
||||
countChange: int = self.getCountChange(self.directionState)
|
||||
self.handleCallbacks(countChange)
|
||||
|
||||
|
||||
self.sensor.close()
|
||||
|
||||
def getCountChange(self, directionState) -> int:
|
||||
|
|
Loading…
Reference in a new issue