eive-tmtc/eive_tmtc/pus_tm/defs.py

22 lines
520 B
Python

import logging
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
class PrintWrapper:
def __init__(self, printer: FsfwTmTcPrinter):
self.printer = printer
def dlog(self, string: str):
print(string)
self.printer.file_logger.info(string)
def ilog(self, logger: logging.Logger, string: str):
logger.info(string)
self.printer.file_logger.info(string)
def log_to_both(printer: FsfwTmTcPrinter, string: str):
print(string)
printer.file_logger.info(string)