cmdstanr icon indicating copy to clipboard operation
cmdstanr copied to clipboard

`show_messages=FALSE` only suppresses `stderr`

Open andrjohns opened this issue 3 years ago • 3 comments

A request that's come up in the BDA course is the ability to supress all output from a $sample() run. At the moment, the best that can be done with show_messages=FALSE and refresh=0 is:

Running MCMC with 4 sequential chains...

Chain 1 finished in 0.1 seconds.
Chain 2 finished in 0.1 seconds.
Chain 3 finished in 0.1 seconds.
Chain 4 finished in 0.1 seconds.

All 4 chains finished successfully.
Mean chain execution time: 0.1 seconds.
Total execution time: 0.8 seconds.

Which I believe is because show_messages doesn't suppress stdout as well. Could be good to either add that as part of the behaviour of show_messages or to add an additional setting to supress all output

andrjohns avatar Nov 11 '22 08:11 andrjohns

I think what we want to do is rethink logging and make a "logging" argument that behaves something along these lines:

  • default TRUE -> log everything
  • FALSE -> log nothing at all
  • "exceptions-only -> show cmdstan exceptions
  • "progress-only" -> show progress and end timings only.

This is a duplicate of https://github.com/stan-dev/cmdstanr/issues/646, but we can keep it as I think this has to be done sooner rather than later :)

rok-cesnovar avatar Nov 11 '22 08:11 rok-cesnovar

I agree this would be nice. I like @rok-cesnovar's logging idea.

jgabry avatar Nov 14 '22 17:11 jgabry

Should we close this now that #746 was merged a while ago and we have show_exceptions? Or do we still want to eventually add a "logging" argument? If the latter we can keep this open.

jgabry avatar Aug 30 '23 16:08 jgabry

Closing this since we have #746. If we want to add additional logging features (I'm open to that) we can open new issues.

jgabry avatar Apr 22 '24 21:04 jgabry