From 3fec9ac0d5af1358d216eb2fdc2000ec0205f3f0 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 13 Sep 2016 10:47:28 -0700 Subject: 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 --- runtime/gc/reference_queue_test.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'runtime/gc/reference_queue_test.cc') diff --git a/runtime/gc/reference_queue_test.cc b/runtime/gc/reference_queue_test.cc index 35bf718875..2a1635dff9 100644 --- a/runtime/gc/reference_queue_test.cc +++ b/runtime/gc/reference_queue_test.cc @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + #include "common_runtime_test.h" #include "reference_queue.h" #include "handle_scope-inl.h" @@ -65,7 +67,9 @@ TEST_F(ReferenceQueueTest, Dump) { StackHandleScope<20> hs(self); Mutex lock("Reference queue lock"); ReferenceQueue queue(&lock); - queue.Dump(LOG(INFO)); + std::ostringstream oss; + queue.Dump(oss); + LOG(INFO) << oss.str(); auto weak_ref_class = hs.NewHandle( Runtime::Current()->GetClassLinker()->FindClass(self, "Ljava/lang/ref/WeakReference;", ScopedNullHandle())); @@ -78,10 +82,16 @@ TEST_F(ReferenceQueueTest, Dump) { ASSERT_TRUE(ref1.Get() != nullptr); auto ref2(hs.NewHandle(finalizer_ref_class->AllocObject(self)->AsReference())); ASSERT_TRUE(ref2.Get() != nullptr); + queue.EnqueueReference(ref1.Get()); - queue.Dump(LOG(INFO)); + oss.str(""); + queue.Dump(oss); + LOG(INFO) << oss.str(); + queue.EnqueueReference(ref2.Get()); - queue.Dump(LOG(INFO)); + oss.str(""); + queue.Dump(oss); + LOG(INFO) << oss.str(); } } // namespace gc -- cgit v1.2.3-59-g8ed1b