@ohos.hiviewdfx.FaultLogExtensionContext (Delayed Fault Notification Context)
FaultLogExtensionContext is the context of FaultLogExtensionAbility and inherits from ExtensionContext.
This module provides APIs for accessing resources of a specific FaultLogExtensionAbility. An ExtensionAbility can use the context directly provided by ExtensionContext or that extended from ExtensionContext.
NOTE
- The initial APIs of this module are supported since API version 21. Newly added APIs will be marked with a superscript to indicate their earliest API version.
- The APIs of this module can be used only in the stage model.
How to Use
You can obtain a FaultLogExtensionContext object through a FaultLogExtensionAbility child class instance.
import { FaultLogExtensionAbility } from '@kit.PerformanceAnalysisKit';
export default class MyFaultLogExtension extends FaultLogExtensionAbility {
onFaultReportReady() {
let context = this.context; // Obtain FaultLogExtensionContext.
console.info('cache dir is ' + context.cacheDir); // Access the members in the context.
}
}
FaultLogExtensionContext
Represents the context of FaultLogExtensionAbility.
System capability: SystemCapability.HiviewDFX.Hiview.FaultLogger
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 js-apis-hiviewdfx-FaultLogExtensionAbility
openharmony 鸿蒙 errorcode-hisysevent-sys
openharmony 鸿蒙 capi-hitrace-hitraceid
openharmony 鸿蒙 capi-hidebug-hidebug-threadcpuusage
openharmony 鸿蒙 js-apis-loglibrary-sys
openharmony 鸿蒙 capi-hiappevent-h