Pi4J / pi4j-v2

Pi4J Version 2.0
Apache License 2.0
266 stars 54 forks source link

MockSpi logging is hard to read because it is broken up across multiple lines #299

Open MMMMMNG opened 9 months ago

MMMMMNG commented 9 months ago

https://github.com/Pi4J/pi4j-v2/blob/8d8f1574f926dfd2961356cf015dcbd58e50664e/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/spi/MockSpi.java#L73C8-L79C23

See title. Even with simple tests the log output gets pretty huge and unreadable rather quickly because there are usually many interactions with the MockSpi object. I would prefer one-liners. For reference, the close() method and its logging:

    @Override
    public void close() {
        logger.info(" [");
        logger.info(Mock.SPI_PROVIDER_NAME);
        logger.info("::");
        logger.info(this.id);
        logger.info("] :: CLOSE(CHANNEL=" + config.address() + "; BAUD=" + config.baud() + ")");
        logger.info("");
        super.close();
    }

It's similar with all methods, even read() and write()