stan icon indicating copy to clipboard operation
stan copied to clipboard

Print statements inside a model are buffered into a stringstream and only printed when log_prob returns

Open WardBrian opened this issue 2 years ago • 0 comments

Summary:

In situations like https://github.com/stan-dev/cmdstan/issues/1207, where there is an infinite loop which never exits, a user may try to debug-by-print the loop condition. This will never be useful, as the infinite loop prevents the code from exiting and actually logging to the user.

Relevant code: https://github.com/stan-dev/stan/blob/b22074b57e459132c160c02267566695a634ec54/src/stan/model/gradient.hpp#L25-L35

Current Version:

v2.33.0

WardBrian avatar Oct 04 '23 14:10 WardBrian