Cargo tool for checking if println statements exist?

To help avoid costly logging in cloud platforms, are there any available cargo tools that will return an error code if any println! statements are found in your non-test code?

For instance, in python you can use flake8 or noprint to detect in the AST print statements.

I'd use this just before running any tests in my CI and fail the build if someone committed println! statements.

Maybe this disallowed_macros clippy lint would work.

5 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.