提交 39c912bb 编写于 作者: W wusongqing

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 3ba98bc6
# Fault Logger # Fault Logger
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> > **NOTE**<br/>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -15,12 +15,12 @@ Enumerates the fault types. ...@@ -15,12 +15,12 @@ Enumerates the fault types.
**System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger **System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger
| Name | Default Value | Description | | Name| Default Value| Description|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| NO_SPECIFIC | 0 | No specific fault type. | | NO_SPECIFIC | 0 | No specific fault type.|
| CPP_CRASH | 2 | C++ program crash. | | CPP_CRASH | 2 | C++ program crash.|
| JS_CRASH | 3 | JS program crash. | | JS_CRASH | 3 | JS program crash.|
| APP_FREEZE | 4 | Application freezing. | | APP_FREEZE | 4 | Application freezing.|
## FaultLogInfo ## FaultLogInfo
...@@ -30,14 +30,14 @@ Defines the data structure of the fault log information. ...@@ -30,14 +30,14 @@ Defines the data structure of the fault log information.
| Name| Type| Description| | Name| Type| Description|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| pid | number | Process ID of the faulty process. | | pid | number | Process ID of the faulty process.|
| uid | number | User ID of the faulty process. | | uid | number | User ID of the faulty process.|
| type | [FaultType](#faulttype) | Fault type. | | type | [FaultType](#faulttype) | Fault type.|
| timestamp | number | Second-level timestamp when the log was generated. | | timestamp | number | Second-level timestamp when the log was generated.|
| reason | string | Reason for the fault. | | reason | string | Reason for the fault.|
| module | string | Module on which the fault occurred. | | module | string | Module on which the fault occurred.|
| summary | string | Summary of the fault. | | summary | string | Summary of the fault.|
| fullLog | string | Full log text. | | fullLog | string | Full log text.|
## faultLogger.querySelfFaultLog ## faultLogger.querySelfFaultLog
...@@ -51,7 +51,7 @@ Obtains the fault information about the current process. This API uses an asynch ...@@ -51,7 +51,7 @@ Obtains the fault information about the current process. This API uses an asynch
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| faultType | [FaultType](#faulttype) | Yes| Fault type. | | faultType | [FaultType](#faulttype) | Yes| Fault type.|
| callback | AsyncCallbackArray&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Yes| Callback used to return the fault information array.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. In this case, an error string will be returned. | callback | AsyncCallbackArray&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Yes| Callback used to return the fault information array.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. In this case, an error string will be returned.
**Example** **Example**
...@@ -68,7 +68,7 @@ function queryFaultLogCallback(error, value) { ...@@ -68,7 +68,7 @@ function queryFaultLogCallback(error, value) {
console.info("Log pid: " + value[i].pid); console.info("Log pid: " + value[i].pid);
console.info("Log uid: " + value[i].uid); console.info("Log uid: " + value[i].uid);
console.info("Log type: " + value[i].type); console.info("Log type: " + value[i].type);
console.info("Log ts: " + value[i].ts); console.info("Log timestamp: " + value[i].timestamp);
console.info("Log reason: " + value[i].reason); console.info("Log reason: " + value[i].reason);
console.info("Log module: " + value[i].module); console.info("Log module: " + value[i].module);
console.info("Log summary: " + value[i].summary); console.info("Log summary: " + value[i].summary);
...@@ -91,13 +91,13 @@ Obtains the fault information about the current process. This API uses a promise ...@@ -91,13 +91,13 @@ Obtains the fault information about the current process. This API uses a promise
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| faultType | [FaultType](#faulttype) | Yes| Fault type. | | faultType | [FaultType](#faulttype) | Yes| Fault type.|
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. | | Promise&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval.|
**Example** **Example**
...@@ -112,7 +112,7 @@ async function getLog() { ...@@ -112,7 +112,7 @@ async function getLog() {
console.info("Log pid: " + value[i].pid); console.info("Log pid: " + value[i].pid);
console.info("Log uid: " + value[i].uid); console.info("Log uid: " + value[i].uid);
console.info("Log type: " + value[i].type); console.info("Log type: " + value[i].type);
console.info("Log ts: " + value[i].ts); console.info("Log timestamp: " + value[i].timestamp);
console.info("Log reason: " + value[i].reason); console.info("Log reason: " + value[i].reason);
console.info("Log module: " + value[i].module); console.info("Log module: " + value[i].module);
console.info("Log summary: " + value[i].summary); console.info("Log summary: " + value[i].summary);
...@@ -120,4 +120,4 @@ async function getLog() { ...@@ -120,4 +120,4 @@ async function getLog() {
} }
} }
} }
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册