diff --git a/en/application-dev/reference/apis/js-apis-hiappevent.md b/en/application-dev/reference/apis/js-apis-hiappevent.md index 4ec4c1062d7915888ae6d13037aa0ff9235e6c2c..101016801113d14a03fae1cd89e5196668de0e4d 100644 --- a/en/application-dev/reference/apis/js-apis-hiappevent.md +++ b/en/application-dev/reference/apis/js-apis-hiappevent.md @@ -6,7 +6,7 @@ ## Modules to Import -``` +```js import hiAppEvent from '@ohos.hiAppEvent'; ``` @@ -30,7 +30,7 @@ Writes event information to the event file of the current day. This API supports **Example** -``` +```js hiAppEvent.write("test_event", hiAppEvent.EventType.FAULT, {"int_data":100, "str_data":"strValue"}, (err, value) => { if (err) { // Event writing exception: Write the event to the event file after the invalid parameters in the event are ignored, or stop writing the event if the event verification fails. @@ -68,7 +68,7 @@ Writes event information to the event file of the current day. This API supports **Example** -``` +```js hiAppEvent.write("test_event", hiAppEvent.EventType.FAULT, {"int_data":100, "str_data":"strValue"}) .then((value) => { // Event writing succeeded. @@ -101,7 +101,7 @@ Configures the application event logging function, such as setting the event log | boolean | Returns **true** if the configuration is successful; returns **false** otherwise.| **Example** -``` +```js // Set the application event logging switch. hiAppEvent.configure({ disable: true diff --git a/en/application-dev/reference/apis/js-apis-hilog.md b/en/application-dev/reference/apis/js-apis-hilog.md index 13814a6e63646a33956f8c7c8a89d919b50a6ea6..7a1a32e72a5bdde07fdc930d457e8a863991a8c0 100644 --- a/en/application-dev/reference/apis/js-apis-hilog.md +++ b/en/application-dev/reference/apis/js-apis-hilog.md @@ -6,7 +6,7 @@ ## Modules to Import -``` +```js import hilog from '@ohos.hilog'; ``` @@ -30,7 +30,7 @@ Prints logs of the DEBUG level. **Example** -``` +```js hilog.debug(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -59,7 +59,7 @@ Prints logs of the INFO level. **Example** -``` +```js hilog.info(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -88,7 +88,7 @@ Prints logs of the WARN level. **Example** -``` +```js hilog.warn(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -117,7 +117,7 @@ Prints logs of the ERROR level. **Example** -``` +```js hilog.error(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -146,7 +146,7 @@ Prints logs of the FATAL level. **Example** -``` +```js hilog.fatal(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -174,7 +174,7 @@ Checks whether printing is enabled for a domain, tag, or log level. **Example** -``` +```js hilog.isLoggable(0xFF00, "testTag", hilog.DEBUG); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-hiappevent.md b/zh-cn/application-dev/reference/apis/js-apis-hiappevent.md index 4f8afa59d5757c72e2510c811e8847ba83f3a38b..1ffa415cc114c461d8c6c5ad43bebd4f74480928 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hiappevent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hiappevent.md @@ -6,7 +6,7 @@ ## 导入模块 -``` +```js import hiAppEvent from '@ohos.hiAppEvent'; ``` @@ -30,7 +30,7 @@ write(eventName: string, eventType: EventType, keyValues: object, callback: Asyn **示例:** -``` +```js hiAppEvent.write("test_event", hiAppEvent.EventType.FAULT, {"int_data":100, "str_data":"strValue"}, (err, value) => { if (err) { // 事件写入异常:事件存在异常参数时忽略异常参数后继续写入,或者事件校验失败时不执行写入 @@ -68,7 +68,7 @@ write(eventName: string, eventType: EventType, keyValues: object): Promise<vo **示例:** -``` +```js hiAppEvent.write("test_event", hiAppEvent.EventType.FAULT, {"int_data":100, "str_data":"strValue"}) .then((value) => { // 事件写入正常 @@ -101,7 +101,7 @@ configure(config: ConfigOption): boolean | boolean | 配置结果,true 表示配置成功,false 表示配置失败。 | **示例:** -``` +```js // 配置应用事件打点功能开关 hiAppEvent.configure({ disable: true diff --git a/zh-cn/application-dev/reference/apis/js-apis-hilog.md b/zh-cn/application-dev/reference/apis/js-apis-hilog.md index 9b9d2ae03726f7ecec0ee84363eae843ccff2129..7c4caaf8d5579f259df88f87602ce8c447bfa38c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hilog.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hilog.md @@ -6,7 +6,7 @@ ## 导入模块 -``` +```js import hilog from '@ohos.hilog'; ``` @@ -30,7 +30,7 @@ debug日志输出,打印debug级别日志。 **示例:** -``` +```js hilog.debug(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -59,7 +59,7 @@ info日志输出,打印info级别日志。 **示例:** -``` +```js hilog.info(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -88,7 +88,7 @@ warn日志输出,打印warn级别日志。 **示例:** -``` +```js hilog.warn(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -117,7 +117,7 @@ error日志输出,打印error级别日志。 **示例:** -``` +```js hilog.error(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -146,7 +146,7 @@ fatal日志输出,打印fatal级别日志。 **示例:** -``` +```js hilog.fatal(0xFF00, "testTag", "%d: %{private}s World %{public}f", 1, "hello", 3.0); ``` @@ -174,7 +174,7 @@ isLoggable(domain: number, tag: string, level: LogLevel) : boolean **示例:** -``` +```js hilog.isLoggable(0xFF00, "testTag", hilog.DEBUG); ```