Browse Source
By default, stdout is line-buffered when connected to a tty but completely buffered when redirected to a file or piped to another program. This makes it hard to get an accurate picture of the current log output and state of a running PRISM instance by looking at a log file or terminal output for something like 'prism ... | tee log-file'. On the other hand, we don't want to call .flush() on the logs all the time manually. By using setvbuf, we set stdout to line-buffered, i.e., it will be flushed automatically for every line-ending. By passing NULL as the buffer pointer, we ask the libc to construct a buffer, passing 1024 as a (reasonable) hint for the buffer size, even for long lines. [from Joachim Klein] git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10127 bbc10eb1-c90d-0410-af57-cb519fbb1720master
1 changed files with 1 additions and 0 deletions
Loading…
Reference in new issue