提交 320f21b7 编写于 作者: Y YOUR_NAME 提交者: mashuang

修改示例

Signed-off-by: NYOUR_NAME <mashuang9@huawei.com>
上级 f2bb5b07
...@@ -73,7 +73,7 @@ function queryFaultLogCallback(error, value) { ...@@ -73,7 +73,7 @@ function queryFaultLogCallback(error, value) {
} }
} }
} }
faultLogger.querySelfFaultLog(faultlogger.FaultType.JS_CRASH, queryFaultLogCallback); faultLogger.querySelfFaultLog(faultLogger.FaultType.JS_CRASH, queryFaultLogCallback);
``` ```
## faultLogger.querySelfFaultLog ## faultLogger.querySelfFaultLog
...@@ -97,20 +97,22 @@ querySelfFaultLog(faultType: FaultType) : Promise&lt;Array&lt;FaultLogInfo&gt;&g ...@@ -97,20 +97,22 @@ querySelfFaultLog(faultType: FaultType) : Promise&lt;Array&lt;FaultLogInfo&gt;&g
**示例:** **示例:**
``` ```
let value = await faultLogger.querySelfFaultLog(faultlogger.FaultType.JS_CRASH); async function getLog() {
if (value) { let value = await faultLogger.querySelfFaultLog(faultLogger.FaultType.JS_CRASH);
console.info("value length is " + value.length); if (value) {
let len = value.length; console.info("value length is " + value.length);
for (let i = 0; i < len; i++) { let len = value.length;
console.info("log: " + i); for (let i = 0; i < len; i++) {
console.info("Log pid: " + value[i].pid); console.info("log: " + i);
console.info("Log uid: " + value[i].uid); console.info("Log pid: " + value[i].pid);
console.info("Log type: " + value[i].type); console.info("Log uid: " + value[i].uid);
console.info("Log ts: " + value[i].ts); console.info("Log type: " + value[i].type);
console.info("Log reason: " + value[i].reason); console.info("Log ts: " + value[i].ts);
console.info("Log module: " + value[i].module); console.info("Log reason: " + value[i].reason);
console.info("Log summary: " + value[i].summary); console.info("Log module: " + value[i].module);
console.info("Log text: " + value[i].fullLog); console.info("Log summary: " + value[i].summary);
console.info("Log text: " + value[i].fullLog);
}
} }
} }
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册