> The initial APIs of this module are supported since API version 7. 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 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...
@@ -23,10 +23,10 @@ Writes event information to the event file of the current day. This API supports
...
@@ -23,10 +23,10 @@ Writes event information to the event file of the current day. This API supports
| eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter.|
| eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter.|
| keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated.|
| keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated.|
| callback | AsyncCallback<void> | No | Callback used to process the received return value.<br>- Value **0** indicates that the event verification is successful, and the event will be written to the event file asynchronously. <br>- A value greater than **0** indicates that invalid parameters are present in the event, and the event will be written to the event file asynchronously after the invalid parameters are ignored. <br>- A value smaller than **0** indicates that the event verification fails, and the event will not be written to the event file.|
| callback | AsyncCallback<void> | No | Callback used to process the received return value.<br>- Value **0** indicates that the event verification is successful, and the event will be written to the event file asynchronously. <br>- A value greater than **0** indicates that invalid parameters are present in the event, and the event will be written to the event file asynchronously after the invalid parameters are ignored. <br>- A value smaller than **0** indicates that the event verification fails, and the event will not be written to the event file.|
**Example**
**Example**
...
@@ -56,15 +56,15 @@ Writes event information to the event file of the current day. This API supports
...
@@ -56,15 +56,15 @@ Writes event information to the event file of the current day. This API supports
| eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter.|
| eventName | string | Yes | App event name.<br>You need to customize the event name. It can contain a maximum of 48 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter.|
| keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated.|
| keyValues | object | Yes | Parameter key-value pair. For a variable-length parameter, enter each pair of parameter name and value in sequence. For a JSON parameter, enter the parameter name as the key and parameter value as the value.<br>- A key must be a string, and a value must be a string, number, boolean, or Array (which can only be a string, number, or boolean).<br>- The number of event parameters must be less than or equal to 32.<br>- The parameter name can contain a maximum of 16 characters, including digits (0 to 9), letters (a to z), and underscores (\_). It must start with a letter and cannot end with an underscore (\_).<br>- A string value can contain a maximum of 8*1024 characters.<br>- An array value can contain a maximum of 100 elements. Excess elements will be truncated.|
| disable | boolean | No | Application event logging switch. The value <b>true</b> means to disable the application event logging function, and the value <b>false</b> means the opposite.|
| disable | boolean | No | Application event logging switch. The value <b>true</b> means to disable the application event logging function, and the value <b>false</b> means the opposite.|
| maxStorage | string | No | Maximum size of the event file storage directory. The default value is **10M**. If the specified size is exceeded, the oldest event logging files in the storage directory will be deleted to free up space.|
| maxStorage | string | No | Maximum size of the event file storage directory. The default value is **10M**. If the specified size is exceeded, the oldest event logging files in the storage directory will be deleted to free up space.|
## EventType
## EventType
...
@@ -150,7 +150,7 @@ Provides constants that define the names of all predefined events.
...
@@ -150,7 +150,7 @@ Provides constants that define the names of all predefined events.
> 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.
...
@@ -22,7 +22,7 @@ Provides the constants of all rule types.
...
@@ -22,7 +22,7 @@ Provides the constants of all rule types.
| RULE\_CAUTION\_PRINT\_LOG | BigInt | Alarm rule, which is programmed to print a log when an alarm is generated. |
| RULE\_CAUTION\_PRINT\_LOG | BigInt | Alarm rule, which is programmed to print a log when an alarm is generated. |
| RULE\_CAUTION\_TRIGGER\_CRASH | BigInt | Alarm rule, which is programmed to force the application to exit when an alarm is generated. |
| RULE\_CAUTION\_TRIGGER\_CRASH | BigInt | Alarm rule, which is programmed to force the application to exit when an alarm is generated. |
| RULE\_THREAD\_CHECK\_SLOW\_PROCESS | BigInt | Caution rule, which is programmed to detect whether any time-consuming function is invoked. |
| RULE\_THREAD\_CHECK\_SLOW\_PROCESS | BigInt | Caution rule, which is programmed to detect whether any time-consuming function is invoked. |
| RULE\_CHECK\_SLOW\_EVENT | BigInt | Caution rule, which is programmed to detect whether the event distribution or processing time has exceeded the specified time threshold.|
| RULE\_CHECK\_SLOW\_EVENT | BigInt | Caution rule, which is programmed to detect whether the event distribution or processing time has exceeded the specified time threshold.|
| RULE\_CHECK\_ABILITY\_CONNECTION\_LEAK| BigInt | Caution rule, which is programmed to detect whether ability leakage has occurred. |
| RULE\_CHECK\_ABILITY\_CONNECTION\_LEAK| BigInt | Caution rule, which is programmed to detect whether ability leakage has occurred. |
...
@@ -36,9 +36,9 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac
...
@@ -36,9 +36,9 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac
**Parameters**
**Parameters**
| Name| Type | Mandatory| Description |
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- |
| ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be added.|
| rule | BigInt | Yes | Rule to be added.|
**Example**
**Example**
...
@@ -61,9 +61,9 @@ Removes one or more rules. The removed rules will become ineffective.
...
@@ -61,9 +61,9 @@ Removes one or more rules. The removed rules will become ineffective.
**Parameters**
**Parameters**
| Name| Type | Mandatory| Description |
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- |
| ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be removed.|
| rule | BigInt | Yes | Rule to be removed.|
**Example**
**Example**
...
@@ -88,7 +88,7 @@ Obtains a collection of thread, process, and alarm rules that have been added.
...
@@ -88,7 +88,7 @@ Obtains a collection of thread, process, and alarm rules that have been added.
| Type | Description |
| Type | Description |
| ------ | ---------------------- |
| ------ | ---------------------- |
| BigInt | Collection of added rules.|
| BigInt | Collection of added rules.|
**Example**
**Example**
...
@@ -110,15 +110,15 @@ Checks whether the specified rule exists in the collection of added rules. If th
...
@@ -110,15 +110,15 @@ Checks whether the specified rule exists in the collection of added rules. If th
> The initial APIs of this module are supported since API version 7. 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 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
## Modules to Import
...
@@ -21,12 +20,12 @@ Prints logs of the DEBUG level.
...
@@ -21,12 +20,12 @@ Prints logs of the DEBUG level.
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
**Example**
**Example**
...
@@ -50,12 +49,12 @@ Prints logs of the INFO level.
...
@@ -50,12 +49,12 @@ Prints logs of the INFO level.
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
**Example**
**Example**
...
@@ -79,12 +78,12 @@ Prints logs of the WARN level.
...
@@ -79,12 +78,12 @@ Prints logs of the WARN level.
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
**Example**
**Example**
...
@@ -108,12 +107,12 @@ Prints logs of the ERROR level.
...
@@ -108,12 +107,12 @@ Prints logs of the ERROR level.
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
**Example**
**Example**
...
@@ -137,12 +136,12 @@ Prints logs of the FATAL level.
...
@@ -137,12 +136,12 @@ Prints logs of the FATAL level.
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| domain | number | Yes | Service domain. The value ranges from **0x0** to **0xFFFFF**. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| tag | string | Yes | String constant used to identify the class or service behavior. |
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| format | string | Yes | String constant format, including the parameter type and privacy identifier. A parameter without the privacy identifier is treated as a privacy parameter by default.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
| args | any[] | Yes | Variable-length parameter list corresponding to the parameter type in the format string. The number and type of parameters must map to the identifier in the format string.|
**Example**
**Example**
...
@@ -166,10 +165,10 @@ Checks whether printing is enabled for a domain, tag, or log level.
...
@@ -166,10 +165,10 @@ Checks whether printing is enabled for a domain, tag, or log level.
> 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.
| INCLUDE_ASYNC | 1 | Asynchronous call flag. By default, only synchronous calls are traced. If this flag is set, both synchronous and asynchronous calls will be traced. |
| INCLUDE_ASYNC | 1 | Asynchronous call flag. By default, only synchronous calls are traced. If this flag is set, both synchronous and asynchronous calls will be traced. |
| DONOT_CREATE_SPAN | 1 << 1 | No span flag. By default, a span is automatically created during tracing of synchronous and asynchronous calls. If this flag is set, no span will be created. |
| DONOT_CREATE_SPAN | 1 << 1 | No span flag. By default, a span is automatically created during tracing of synchronous and asynchronous calls. If this flag is set, no span will be created. |
| TP_INFO | 1 << 2 | Trace point flag. By default, no trace point is added when tracing is enabled. This flag is used for debugging. If this flag is set, trace points will be automatically added on the TX and RX sides of synchronous and asynchronous calls to output trace point and timestamp information. Trace points are classified into four types: [CS, SR, SS, and CR](#hitracetracepointtype). For a synchronous call, the output trace points are CS, SR, SS, and CR; for an asynchronous call, the output trace points are CS, SR, and SS. |
| TP_INFO | 1 << 2 | Trace point flag. By default, no trace point is added when tracing is enabled. This flag is used for debugging. If this flag is set, trace points will be automatically added on the TX and RX sides of synchronous and asynchronous calls to output trace point and timestamp information. Trace points are classified into four types: [CS, SR, SS, and CR](#hitracetracepointtype). For a synchronous call, the output trace points are CS, SR, SS, and CR; for an asynchronous call, the output trace points are CS, SR, and SS. |
| NO_BE_INFO | 1 << 3 | No begin/end flag. By default, information about the start and end of the trace task is printed. If this flag is set, information about the start and end of the trace task will not be printed.|
| NO_BE_INFO | 1 << 3 | No begin/end flag. By default, information about the start and end of the trace task is printed. If this flag is set, information about the start and end of the trace task will not be printed.|
| DISABLE_LOG | 1 << 4 | Log association flag. If this flag is set, information about the trace task will not be printed. |
| DISABLE_LOG | 1 << 4 | Log association flag. If this flag is set, information about the trace task will not be printed. |
| FAILURE_TRIGGER | 1 << 5 | Failure trigger flag. This flag is reserved for future use. |
| FAILURE_TRIGGER | 1 << 5 | Failure trigger flag. This flag is reserved for future use. |
| D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag. It is a subset of **TP_INFO**. If this flag is set, trace points are added only for call chain tracing between devices.|
| D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag. It is a subset of **TP_INFO**. If this flag is set, trace points are added only for call chain tracing between devices.|