mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Make sure output() doesn't always write to stderr
This commit is contained in:
parent
7e1abc439b
commit
24c84e394c
2 changed files with 4 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ void output(const std::string& message, std::ostream& out, int indent)
|
|||
while (i_start < length) {
|
||||
if (length - i_start < line_len) {
|
||||
// Remainder of message will fit on line
|
||||
std::cerr << message.substr(i_start) << '\n';
|
||||
out << message.substr(i_start) << '\n';
|
||||
break;
|
||||
|
||||
} else {
|
||||
|
|
@ -42,7 +42,7 @@ void output(const std::string& message, std::ostream& out, int indent)
|
|||
auto pos = s.find_last_of(' ');
|
||||
|
||||
// Write up to last space, or whole line if no space is present
|
||||
std::cerr << s.substr(0, pos) << '\n' << std::setw(indent) << " ";
|
||||
out << s.substr(0, pos) << '\n' << std::setw(indent) << " ";
|
||||
|
||||
// Advance starting position
|
||||
i_start += (pos == std::string::npos) ? line_len : pos + 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue