!522 support print ark log

Merge pull request !522 from changcheng/master
This commit is contained in:
openharmony_ci 2022-02-10 14:37:53 +00:00 committed by Gitee
commit f90bbdbb8a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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"
@ -128,12 +129,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<void *>(option.GetLogBufPrint()));
Logger::SetMobileLogPrintEntryPointByPtr(reinterpret_cast<void *>(option.GetLogBufPrint()));
}
runtimeOptions.SetEnableArkTools(option.GetEnableArkTools());