ART: Allow scoped adjustments to log verbosity
Add ScopedLogSeverity to adjust the logging level.
Suppress warnings by default in gtests. Suppress errors in instances
where errors are expected.
Change-Id: If3ef865813e9505ab60bc90baed63ff11d90afbb
diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc
index f3e0918..0764b87 100644
--- a/runtime/base/logging.cc
+++ b/runtime/base/logging.cc
@@ -303,4 +303,13 @@
#endif
}
+ScopedLogSeverity::ScopedLogSeverity(LogSeverity level) {
+ old_ = gMinimumLogSeverity;
+ gMinimumLogSeverity = level;
+}
+
+ScopedLogSeverity::~ScopedLogSeverity() {
+ gMinimumLogSeverity = old_;
+}
+
} // namespace art