Getting logging working in the classes. Well one is enough for now

This commit is contained in:
nzkarit
2017-09-18 23:15:20 +12:00
parent 3170515490
commit 85b91a0719
2 changed files with 12 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import numpy
import logging
###############################################################
# Further work on fork
# Copyright (C) 2017 David Robinson
@@ -6,6 +7,10 @@ class HackRF:
"""The HackRF class has functions from converting data into a format into which the hackrf can process
"""
logger = None
def __init__(self):
self.logger = logging.getLogger(__name__)
def hackrf_raw_IQ_format(self, ppm):
"""
@@ -15,7 +20,8 @@ class HackRF:
Returns:
bytearray: containing the IQ data
"""
print(self.logger)
self.logger.debug('Creating hackRF bytearray from the ppm stuff')
signal = []
bits = numpy.unpackbits(numpy.asarray(ppm, dtype=numpy.uint8))
for bit in bits: