storm icon indicating copy to clipboard operation
storm copied to clipboard

Avoid std::cout and std::endl

Open volkm opened this issue 2 years ago • 4 comments

Currently, some parts of the code are still using std::cout. We should revise them to use our custom macros such as STORM_LOG_INFO or STORM_PRINT_AND_LOG.

In addition, we opt to use \n instead of std::endl, see PR #178. The files GradientDescentInstantiationSearcher.cpp and SparseDerivativeInstantiationModelChecker.cpp should be adapted accordingly.

volkm avatar Aug 10 '22 09:08 volkm

Hello, I am Ashish Padhy (Sophomore at Bachelor's) and am kind of beginning my open source journey. So can you please clarify how to choose the macro to replace std::cout . Thanks for your help.

Shurtu-gal avatar Aug 10 '22 13:08 Shurtu-gal

PR #277 addressed the two files you mentioned. Someone should check for other misplaces occurences of std::cout

@Shurtu-gal the macros allow us to control the tool output on a global level. For example, we could easily implement a compile-time option that disables all output.

tquatmann avatar Aug 17 '22 18:08 tquatmann

If there are any other source files that require similar enhancements, I'd be very happy to help with them as well :D This issue helped me find a good example of macro use in a mature code base and I am grateful for that experience

Legoeggolas avatar Aug 17 '22 19:08 Legoeggolas

@tquatmann Thanks for the heads up. Would be happy to contribute to other issues.

Shurtu-gal avatar Aug 20 '22 21:08 Shurtu-gal