Description:fix js log cannot print bug
Sig: SIG_ApplicationFramework
Feature or Bugfix:Bugfix
Binary Source:No

Signed-off-by: liqiang <liqiang121@huawei.com>
Change-Id: I6e59376798072e29a91bb3efb2d07aa64f3da98a
This commit is contained in:
liqiang 2022-08-03 19:45:52 +08:00
parent 3eb5f8f014
commit 3bda96cc9c

View File

@ -23,6 +23,9 @@
namespace OHOS {
namespace AbilityRuntime {
namespace {
static const uint32_t JS_CONSOLE_LOG_DOMAIN = 0xFEFE;
static const char* JS_CONSOLE_LOG_TAG = "JsApp";
std::string MakeLogContent(NativeCallbackInfo& info)
{
std::string content;
@ -67,7 +70,7 @@ NativeValue* ConsoleLog(NativeEngine* engine, NativeCallbackInfo* info)
}
std::string content = MakeLogContent(*info);
HiLogPrint(LOG_APP, LEVEL, AMS_LOG_DOMAIN, "JsApp", "%{public}s", content.c_str());
HiLogPrint(LOG_APP, LEVEL, JS_CONSOLE_LOG_DOMAIN, JS_CONSOLE_LOG_TAG, "%{public}s", content.c_str());
return engine->CreateUndefined();
}