import logging


class Serial:
    def __init__(self, *args, **kwargs):
        self.log = logging.getLogger(f"dummy {self.__class__.__name__} ({id(self)}) (dummy)")
        self.log.debug(f"__init__(*{args}, **{kwargs})")

    def write(self, d):
        self.log.debug(f"write: {d!r}")

    def read(self, n):
        d = b"\x00" * n
        self.log.debug(f"read: {d!r}")
        return d

    def readline(self, n=-1):
        if n < 0:
            n = 8
        d = b"\x00" * n
        self.log.debug(f"readline: {d!r}")
        return d

    def close(self):
        self.log.debug("close")

    def flush(self):
        self.log.debug("flush")

    def reset_output_buffer(self):
        self.log.debug("reset_output_buffer")

    def reset_input_buffer(self):
        self.log.debug("reset_input_buffer")
