From 24c84e394ca3b075bbb11c188d113470a833a2fc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 14 Feb 2019 06:39:48 -0600 Subject: [PATCH] Make sure output() doesn't always write to stderr --- src/error.cpp | 4 ++-- src/output.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index 38001b72a7..cc63c9bc3d 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -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; diff --git a/src/output.cpp b/src/output.cpp index dbfb2ab7b9..5f4a53cdc8 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -65,7 +65,7 @@ void title() " ############### %%%%%%%%%%%%%%%%\n" << " ############ %%%%%%%%%%%%%%%\n" << " ######## %%%%%%%%%%%%%%\n" << - " %%%%%%%%%%%\n"; + " %%%%%%%%%%%\n\n"; // Write version information std::cout << @@ -88,7 +88,7 @@ void title() #ifdef _OPENMP // Write number of OpenMP threads - std::cout << " OpenMC Threads | " << omp_get_max_threads() << '\n'; + std::cout << " OpenMP Threads | " << omp_get_max_threads() << '\n'; #endif std::cout << '\n'; }