summaryrefslogtreecommitdiffstats
path: root/third_party/re2/util/logging.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/re2/util/logging.h')
-rw-r--r--third_party/re2/util/logging.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/third_party/re2/util/logging.h b/third_party/re2/util/logging.h
index 7302ea6..53f7198 100644
--- a/third_party/re2/util/logging.h
+++ b/third_party/re2/util/logging.h
@@ -53,24 +53,17 @@
class LogMessage {
public:
- LogMessage(const char* file, int line) : flushed_(false) {
+ LogMessage(const char* file, int line) {
stream() << file << ":" << line << ": ";
}
- void Flush() {
+ ~LogMessage() {
stream() << "\n";
string s = str_.str();
if(write(2, s.data(), s.size()) < 0) {} // shut up gcc
- flushed_ = true;
- }
- ~LogMessage() {
- if (!flushed_) {
- Flush();
- }
}
ostream& stream() { return str_; }
private:
- bool flushed_;
std::ostringstream str_;
DISALLOW_EVIL_CONSTRUCTORS(LogMessage);
};
@@ -80,7 +73,7 @@ class LogMessageFatal : public LogMessage {
LogMessageFatal(const char* file, int line)
: LogMessage(file, line) { }
~LogMessageFatal() {
- Flush();
+ std::cerr << "\n";
abort();
}
private: