summaryrefslogtreecommitdiff
path: root/lld/Common
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-12-11 21:57:31 +0000
committerSam Clegg <sbc@chromium.org>2017-12-11 21:57:31 +0000
commit0d0a39dcdeb0c3f619305769c8570b8bc2e2b4ce (patch)
tree4fff06ed0e9962c23e3481faf37f1e70366ff41c /lld/Common
parent9effc5a5e47460243a240b3066b3e16d04d43b89 (diff)
Use ErrorOS for log messages as well as error
log are also diagnostics so it seems like they should to the same place as errors and debug messages. Without this change when I enable --verbose those messages go to stdout, but when I enable "-mllvm -debug" those messages go to stderr (because dbgs() goes to stderr by default). So I end up having to do this a lot: lld <args> > output_message 2>&1 Differential Revision: https://reviews.llvm.org/D41033
Diffstat (limited to 'lld/Common')
-rw-r--r--lld/Common/ErrorHandler.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lld/Common/ErrorHandler.cpp b/lld/Common/ErrorHandler.cpp
index cd9f38c4a29..18affce4d5a 100644
--- a/lld/Common/ErrorHandler.cpp
+++ b/lld/Common/ErrorHandler.cpp
@@ -73,8 +73,7 @@ void ErrorHandler::print(StringRef S, raw_ostream::Colors C) {
void ErrorHandler::log(const Twine &Msg) {
if (Verbose) {
std::lock_guard<std::mutex> Lock(Mu);
- outs() << LogName << ": " << Msg << "\n";
- outs().flush();
+ *ErrorOS << LogName << ": " << Msg << "\n";
}
}