ART: Use libbase logging
Move most of our logging infrastructure over to system/core/base.
Retain VLOG.
Using unified Android infrastructure has two main advantages. First,
it reduces the complexity/maintenance burden in ART. Second, it
allows to detach logging for the cases where we do not want or need
a runtime, e.g., dexdump, the disassembler, etc. As a part of the
latter, libbase is also supported for all hosts (including Windows).
From a developer viewpoint, there are minor behavior changes for the
LOG statements (see above), but otherwise usage is the same. Explicit
severity enum items are in the android::base namespace now.
Bug: 31338270
Test: m test-art-host
Change-Id: I5abcb2f45f5b03d49951874c48544f72a283a91b
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 2be3b52..5bb38f5 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -255,7 +255,7 @@
// This can't be called from the Heap destructor below because it
// could call RosAlloc::InspectAll() which needs the thread_list
// to be still alive.
- heap_->DumpGcPerformanceInfo(LOG(INFO));
+ heap_->DumpGcPerformanceInfo(LOG_STREAM(INFO));
}
Thread* self = Thread::Current();
@@ -433,14 +433,14 @@
// Many people have difficulty distinguish aborts from crashes,
// so be explicit.
AbortState state;
- LOG(INTERNAL_FATAL) << Dumpable<AbortState>(state);
+ LOG(FATAL_WITHOUT_ABORT) << Dumpable<AbortState>(state);
// Call the abort hook if we have one.
if (Runtime::Current() != nullptr && Runtime::Current()->abort_ != nullptr) {
- LOG(INTERNAL_FATAL) << "Calling abort hook...";
+ LOG(FATAL_WITHOUT_ABORT) << "Calling abort hook...";
Runtime::Current()->abort_();
// notreached
- LOG(INTERNAL_FATAL) << "Unexpectedly returned from abort hook!";
+ LOG(FATAL_WITHOUT_ABORT) << "Unexpectedly returned from abort hook!";
}
#if defined(__GLIBC__)