diff --git a/devices/statistics_writer/hdf5_writer.py b/devices/statistics_writer/hdf5_writer.py index 7b1f21a0d79b9fb2a39919759268c0589d236a53..197c3242fe48a8f99d4d1e79eb5412a6b8d90e2a 100644 --- a/devices/statistics_writer/hdf5_writer.py +++ b/devices/statistics_writer/hdf5_writer.py @@ -15,8 +15,7 @@ from devices.sdp.statistics_packet import SSTPacket, XSTPacket, BSTPacket, Stati import devices.sdp.statistics_collector as statistics_collector -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger("hdf5_writer") +logger = logging.getLogger("statistics_writer") __all__ = ["hdf5_writer"] @@ -100,7 +99,7 @@ class hdf5_writer: # only write the specified fraction of statistics, skip the rest if self.statistics_counter % self.decimation_factor != 0: - logger.info(f"Skipping statistic with timestamp: {timestamp}. Only writing 1/{self.decimation_factor} statistics") + logger.debug(f"Skipping statistic with timestamp: {timestamp}. Only writing 1/{self.decimation_factor} statistics") # increment even though its skipped self.statistics_counter += 1 @@ -109,7 +108,7 @@ class hdf5_writer: # received new statistic, so increment counter self.statistics_counter += 1 - logger.info(f"starting new matrix with timestamp: {timestamp}") + logger.debug(f"starting new matrix with timestamp: {timestamp}") # write the finished (and checks if its the first matrix) if self.current_matrix is not None: @@ -128,7 +127,7 @@ class hdf5_writer: self.statistics_header = None def write_matrix(self): - logger.info("writing matrix to file") + logger.debug("writing matrix to file") """ Writes the finished matrix to the hdf5 file """ @@ -170,7 +169,6 @@ class hdf5_writer: def process_packet(self, packet): - logger.debug(f"Processing packet") """ Adds the newly received statistics packet to the statistics matrix """ @@ -238,5 +236,7 @@ class hdf5_writer: try: self.write_matrix() finally: + filename = str(self.file) self.file.close() - logger.debug(f"{self.file} closed") + logger.debug(f"{filename} closed") + logger.debug(f"Received a total of {self.statistics_counter} statistics while running. With {int(self.statistics_counter/self.decimation_factor)} written to disk ")