Reviewers: Mads Ager,

Description:
Hook up the log facility of Android platform.


Please review this at http://codereview.chromium.org/155443

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/platform-posix.cc


Index: src/platform-posix.cc
===================================================================
--- src/platform-posix.cc       (revision 2446)
+++ src/platform-posix.cc       (working copy)
@@ -42,11 +42,15 @@
  #include <netinet/in.h>
  #include <netdb.h>

+#if defined(ANDROID)
+#define LOG_TAG "v8"
+#include <utils/Log.h>  // LOG_PRI_VA
+#endif
+
  #include "v8.h"

  #include "platform.h"

-
  namespace v8 {
  namespace internal {

@@ -126,7 +130,11 @@


  void OS::VPrint(const char* format, va_list args) {
+#if defined(ANDROID)
+  LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args);
+#else
    vprintf(format, args);
+#endif
  }


@@ -139,7 +147,11 @@


  void OS::VPrintError(const char* format, va_list args) {
+#if defined(ANDROID)
+  LOG_PRI_VA(ANDROID_LOG_ERROR, LOG_TAG, format, args);
+#else
    vfprintf(stderr, format, args);
+#endif
  }





--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to