Clean up verbose logging.
Change-Id: I6b01980e7145c4f8d25a5b50f620903f61a1b427
diff --git a/src/logging.h b/src/logging.h
index b653931..51d4496 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -121,6 +121,9 @@
#define UNIMPLEMENTED(level) LOG(level) << __PRETTY_FUNCTION__ << " unimplemented "
+#define VLOG_IS_ON(module) UNLIKELY(::art::gLogVerbosity.module)
+#define VLOG(module) if (VLOG_IS_ON(module)) ::art::LogMessage(__FILE__, __LINE__, INFO, -1).stream()
+
//
// Implementation details beyond this point.
//
@@ -197,6 +200,23 @@
return os;
}
+// The members of this struct are the valid arguments to VLOG and VLOG_IS_ON in code,
+// and the "-verbose:" command line argument.
+struct LogVerbosity {
+ bool class_linker; // Enabled with "-verbose:class".
+ bool compiler;
+ bool heap;
+ bool gc;
+ bool jdwp;
+ bool jni;
+ bool monitor;
+ bool startup;
+ bool third_party_jni; // Enabled with "-verbose:third-party-jni".
+ bool threads;
+};
+
+extern LogVerbosity gLogVerbosity;
+
} // namespace art
#endif // ART_SRC_LOGGING_H_