eive-tmtc/eive_tmtc/pus_tm/defs.py

22 lines
520 B
Python
Raw Normal View History

2023-02-01 20:11:47 +01:00
import logging
2022-07-08 16:25:46 +02:00
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
2022-05-10 18:00:56 +02:00
class PrintWrapper:
def __init__(self, printer: FsfwTmTcPrinter):
self.printer = printer
def dlog(self, string: str):
print(string)
self.printer.file_logger.info(string)
2023-02-01 20:11:47 +01:00
def ilog(self, logger: logging.Logger, string: str):
logger.info(string)
self.printer.file_logger.info(string)
2022-05-10 18:00:56 +02:00
def log_to_both(printer: FsfwTmTcPrinter, string: str):
print(string)
printer.file_logger.info(string)