This allows us to grep & process the output easier.
PiperOrigin-RevId: 260989162
This commit is contained in:
parent
75877ac1ea
commit
6c8f1ee32a
@ -46,10 +46,19 @@ class LoggingWrapper {
|
|||||||
std::stringstream& Stream() { return stream_; }
|
std::stringstream& Stream() { return stream_; }
|
||||||
~LoggingWrapper() {
|
~LoggingWrapper() {
|
||||||
if (should_log_) {
|
if (should_log_) {
|
||||||
|
switch (severity_) {
|
||||||
|
case LogSeverity::INFO:
|
||||||
|
case LogSeverity::WARN:
|
||||||
|
std::cout << stream_.str() << std::endl;
|
||||||
|
break;
|
||||||
|
case LogSeverity::ERROR:
|
||||||
|
std::cerr << stream_.str() << std::endl;
|
||||||
|
break;
|
||||||
|
case LogSeverity::FATAL:
|
||||||
std::cerr << stream_.str() << std::endl;
|
std::cerr << stream_.str() << std::endl;
|
||||||
if (severity_ == LogSeverity::FATAL) {
|
|
||||||
std::flush(std::cerr);
|
std::flush(std::cerr);
|
||||||
std::abort();
|
std::abort();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user