diff --git a/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h b/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h index fe200c07df..671407ac7e 100644 --- a/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h +++ b/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h @@ -52,33 +52,36 @@ v8::Local CreateV8String(v8::Isolate* i, const char* str, const int& len = -1); v8::Local CreateV8String(v8::Isolate* i, const std::string& str); +#ifdef __ANDROID__ + +#ifdef _DEBUG #define ANDROID_LOGS +#endif + #ifdef ANDROID_LOGS -//#define ANDROID_LOGS_ALL_FUNCTIONS #include #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, "js", __VA_ARGS__) #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "js", __VA_ARGS__) #endif +#endif + #if V8_OS_XP class MallocArrayBufferAllocator : public v8::ArrayBuffer::Allocator { public: virtual void* Allocate(size_t length) { - LOGW("allocate: %d\n", (int)length); void* ret = malloc(length); memset(ret, 0, length); return ret; } virtual void* AllocateUninitialized(size_t length) { - LOGW("allocate_uninitialized: %d\n", (int)length); return malloc(length); } virtual void Free(void* data, size_t length) { - LOGW("free: %d\n", (int)length); free(data); } }; @@ -492,12 +495,6 @@ namespace NSJSBase CInspectorPool::get().getInspector(V8IsolateOneArg).startAgent(false); #endif -#ifdef ANDROID_LOGS_ALL_FUNCTIONS - std::string sFuncName(name); - std::string sFunc = "[JS call_func: " + sFuncName + "]"; - LOGW(sFunc.c_str()); -#endif - LOGGER_START v8::Local _name = CreateV8String(CV8Worker::GetCurrent(), name); @@ -531,11 +528,6 @@ namespace NSJSBase LOGGER_LAP_NAME(name) -#ifdef ANDROID_LOGS_ALL_FUNCTIONS - sFunc = "[JS call_func_end: " + sFuncName + "]"; - LOGW(sFunc.c_str()); -#endif - JSSmart _ret = _return; return _ret; }