From 46ffc78886cd982e563dc510500395d67adf4fe8 Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Mon, 25 Apr 2022 14:16:42 +0800 Subject: [PATCH] fix the comments of JS code Signed-off-by: lyj_love_code --- .../reference/apis/js-apis-hiappevent.md | 8 ++++---- en/application-dev/reference/apis/js-apis-hilog.md | 14 +++++++------- .../reference/apis/js-apis-hiappevent.md | 8 ++++---- .../reference/apis/js-apis-hilog.md | 14 +++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-hiappevent.md b/en/application-dev/reference/apis/js-apis-hiappevent.md index 4ec4c1062d..1010168011 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 13814a6e63..7a1a32e72a 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 4f8afa59d5..1ffa415cc1 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 9b9d2ae037..7c4caaf8d5 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); ``` -- GitLab