From 83178df77e89cc916d3bb8156c5815ad93df5a40 Mon Sep 17 00:00:00 2001 From: wengchangcheng Date: Thu, 10 Feb 2022 17:50:29 +0800 Subject: [PATCH] support print ark log issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4T6XR Signed-off-by: wengchangcheng --- ecmascript/napi/jsnapi.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ecmascript/napi/jsnapi.cpp b/ecmascript/napi/jsnapi.cpp index 30b4180b0a..93e48d72f8 100755 --- a/ecmascript/napi/jsnapi.cpp +++ b/ecmascript/napi/jsnapi.cpp @@ -50,6 +50,7 @@ #include "ecmascript/mem/region.h" #include "ecmascript/object_factory.h" #include "ecmascript/tagged_array.h" +#include "generated/base_options.h" #include "include/runtime_notification.h" #include "libpandabase/os/library_loader.h" #include "utils/pandargs.h" @@ -134,12 +135,14 @@ bool JSNApi::CreateRuntime(const RuntimeOption &option) runtimeOptions.SetBootClassSpaces({"ecmascript"}); // Dfx - runtimeOptions.SetLogLevel(option.GetLogLevel()); + base_options::Options baseOptions(""); + baseOptions.SetLogLevel(option.GetLogLevel()); arg_list_t logComponents; logComponents.emplace_back("all"); - runtimeOptions.SetLogComponents(logComponents); + baseOptions.SetLogComponents(logComponents); + Logger::Initialize(baseOptions); if (option.GetLogBufPrint() != nullptr) { - runtimeOptions.SetMobileLog(reinterpret_cast(option.GetLogBufPrint())); + Logger::SetMobileLogPrintEntryPointByPtr(reinterpret_cast(option.GetLogBufPrint())); } runtimeOptions.SetEnableArkTools(option.GetEnableArkTools()); -- Gitee