Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MMMMMNG opened this issue Oct 6, 2023 · 0 comments

Comments

@MMMMMNG
Copy link
Contributor

MMMMMNG commented Oct 6, 2023

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant