未验证 提交 716846c4 编写于 作者: O openharmony_ci 提交者: Gitee

!4075 【OpenHarmony开源贡献者计划2022】相关格式及表达问题-3

Merge pull request !4075 from king_he/api-c
# HiAppEvent
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> 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
| Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | ------------------------------------------------------------ |
| 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. |
| eventType | [EventType](#eventtype) | Yes | Application event type. |
| 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&lt;void&gt; | No | Callback used to process the received return value.<br>-&nbsp; Value **0** indicates that the event verification is successful, and the event will be written to the event file asynchronously. <br>-&nbsp; 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>-&nbsp; A value smaller than **0** indicates that the event verification fails, and the event will not be written to the event file.|
| 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&lt;void&gt; | No | Callback used to process the received return value.<br>-&nbsp; Value **0** indicates that the event verification is successful, and the event will be written to the event file asynchronously. <br>-&nbsp; 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>-&nbsp; A value smaller than **0** indicates that the event verification fails, and the event will not be written to the event file. |
**Example**
......@@ -56,15 +56,15 @@ Writes event information to the event file of the current day. This API supports
| Name | Type | Mandatory| Description |
| --------- | ----------------------- | ---- | ------------------------------------------------------------ |
| 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. |
| eventType | [EventType](#eventtype) | Yes | Application event type. |
| 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. |
**Return value**
| Type | Description |
| ------------------- | ------------------------------------------------------------ |
| Promise&lt;void&gt; | Promise used to process the callback in the then() and catch() methods when event writing succeeded or failed.|
| Promise&lt;void&gt; | Promise used to process the callback in the then() and catch() methods when event writing succeeded or failed. |
**Example**
......@@ -92,13 +92,13 @@ Configures the application event logging function, such as setting the event log
| Name| Type | Mandatory| Description |
| ------ | ----------------------------- | ---- | ------------------------ |
| config | [ConfigOption](#configoption) | Yes | Configuration items for application event logging.|
| config | [ConfigOption](#configoption) | Yes | Configuration items for application event logging. |
**Return value**
| Type | Description |
| ------- | ----------------------------------------------------------- |
| boolean | Returns **true** if the configuration is successful; returns **false** otherwise.|
| boolean | Returns **true** if the configuration is successful; returns **false** otherwise. |
**Example**
```js
......@@ -122,8 +122,8 @@ Provides the configuration items for application event logging.
| Name | Type | Mandatory| Description |
| ---------- | ------- | ---- | ------------------------------------------------------------ |
| 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.|
| 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. |
## EventType
......@@ -150,7 +150,7 @@ Provides constants that define the names of all predefined events.
| ------------------------- | -------- | ---- | ---- | -------------------- |
| USER_LOGIN | string | Yes | No | User login event. |
| USER_LOGOUT | string | Yes | No | User logout event. |
| DISTRIBUTED_SERVICE_START | string | Yes | No | Distributed service startup event.|
| DISTRIBUTED_SERVICE_START | string | Yes | No | Distributed service startup event. |
## Param
......@@ -159,8 +159,8 @@ Provides constants that define the names of all predefined event parameters.
**System capability**: SystemCapability.HiviewDFX.HiAppEvent
| Name | Type| Readable| Writable| Description |
| Name | Type | Readable | Writable | Description |
| ------------------------------- | -------- | ---- | ---- | ------------------ |
| USER_ID | string | Yes | No | Custom user ID. |
| DISTRIBUTED_SERVICE_NAME | string | Yes | No | Distributed service name. |
| DISTRIBUTED_SERVICE_INSTANCE_ID | string | Yes | No | Distributed service instance ID.|
| DISTRIBUTED_SERVICE_NAME | string | Yes | No | Distributed service name. |
| DISTRIBUTED_SERVICE_INSTANCE_ID | string | Yes | No | Distributed service instance ID. |
\ No newline at end of file
# HiChecker
> **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **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.
......@@ -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\_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\_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. |
......@@ -36,9 +36,9 @@ Adds one or more rules. HiChecker detects unexpected operations or gives feedbac
**Parameters**
| Name| Type | Mandatory| Description |
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be added.|
| rule | BigInt | Yes | Rule to be added. |
**Example**
......@@ -61,9 +61,9 @@ Removes one or more rules. The removed rules will become ineffective.
**Parameters**
| Name| Type | Mandatory| Description |
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be removed.|
| rule | BigInt | Yes | Rule to be removed. |
**Example**
......@@ -88,7 +88,7 @@ Obtains a collection of thread, process, and alarm rules that have been added.
| Type | Description |
| ------ | ---------------------- |
| BigInt | Collection of added rules.|
| BigInt | Collection of added rules. |
**Example**
......@@ -110,15 +110,15 @@ Checks whether the specified rule exists in the collection of added rules. If th
**Parameters**
| Name| Type | Mandatory| Description |
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------- |
| rule | BigInt | Yes | Rule to be checked.|
| rule | BigInt | Yes | Rule to be checked. |
**Return value**
| Type | Description |
| ------- | ---------------------------------------------------------- |
| boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise.|
| boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise. |
**Example**
......@@ -129,4 +129,4 @@ hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS);
// Check whether the added rule exists in the collection of added rules.
hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // Return true.
hichecker.contains(hichecker.RULE_CAUTION_PRINT_LOG); // Return false.
```
```
\ No newline at end of file
# HiLog
> **Note:**
>
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> 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
......@@ -21,12 +20,12 @@ Prints logs of the DEBUG level.
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ |
| 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. |
| 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.|
| 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. |
| 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. |
**Example**
......@@ -50,12 +49,12 @@ Prints logs of the INFO level.
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ |
| 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. |
| 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.|
| 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. |
| 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. |
**Example**
......@@ -79,12 +78,12 @@ Prints logs of the WARN level.
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ |
| 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. |
| 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.|
| 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. |
| 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. |
**Example**
......@@ -108,12 +107,12 @@ Prints logs of the ERROR level.
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ |
| 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. |
| 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.|
| 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. |
| 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. |
**Example**
......@@ -137,12 +136,12 @@ Prints logs of the FATAL level.
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory | Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ |
| 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. |
| 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.|
| 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. |
**Example**
......@@ -166,10 +165,10 @@ Checks whether printing is enabled for a domain, tag, or log level.
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory | Description |
| ------ | --------------------- | ---- | ------------------------------------------ |
| 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. |
| level | [LogLevel](#loglevel) | Yes | Log level. |
**Example**
......@@ -184,10 +183,10 @@ Enumerates event types.
**System capability**: SystemCapability.HiviewDFX.HiLog
| Name | Default Value| Description |
| Name | Default Value | Description |
| ----- | ------ | ----------- |
| DEBUG | 3 | DEBUG level|
| DEBUG | 3 | DEBUG level |
| INFO | 4 | INFO level |
| WARN | 5 | WARN level |
| ERROR | 6 | ERROR level|
| FATAL | 7 | FATAL level|
| ERROR | 6 | ERROR level |
| FATAL | 7 | FATAL level |
# Distributed Call Chain Tracing
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **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.
## Modules to Import
......@@ -16,16 +16,16 @@ Enumerates trace flag types.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description|
| Name | Default Value | Description |
| -------- | -------- | -------- |
| DEFAULT | 0 | Default flag. |
| 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. |
| 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.|
| DEFAULT | 0 | Default flag. |
| 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. |
| 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. |
| 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. |
| 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. |
## HiTraceTracepointType
......@@ -33,13 +33,13 @@ Enumerates trace point types.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description|
| Name| Default Value | Description |
| -------- | -------- | -------- |
| CS | 0 | Client Send (CS) trace point. |
| CR | 1 | Client Receive (CS) trace point. |
| SS | 2 | Server Send (SS) trace point. |
| SR | 3 | Server Receive (SR) trace point. |
| GENERAL | 4 | General trace points except CS, CR, SS, and SR.|
| CS | 0 | Client Send (CS) trace point. |
| CR | 1 | Client Receive (CS) trace point. |
| SS | 2 | Server Send (SS) trace point. |
| SR | 3 | Server Receive (SR) trace point. |
| GENERAL | 4 | General trace points except CS, CR, SS, and SR. |
## HiTraceCommunicationMode
......@@ -47,9 +47,9 @@ Enumerates communication modes.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description|
| Name| Default Value | Description |
| -------- | -------- | -------- |
| DEFAULT | 0 | Default communication mode. |
| DEFAULT | 0 | Default communication mode. |
| THREAD | 1 | Inter-thread communication. |
| PROCESS | 2 | Inter-process communication. |
| DEVICE | 3 | Inter-device communication. |
......@@ -60,12 +60,12 @@ Defines a **HiTraceId** object.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| chainId | bigint | Yes| Call chain ID. |
| spanId | number | No| Span ID. |
| parentSpanId | number | No| Parent span ID. |
| flags | number | No| Trace flag combination.|
| chainId | bigint | Yes| Call chain ID. |
| spanId | number | No| Span ID. |
| parentSpanId | number | No| Parent span ID. |
| flags | number | No| Trace flag combination. |
## hiTraceChain.begin
......@@ -77,16 +77,16 @@ Starts call chain tracing. This API works in synchronous manner.
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| name | string | Yes| Traced service name.|
| flags | number | Yes| Trace flag combination. For details, see [HiTraceFlag](#hitraceflag).|
| name | string | Yes| Traced service name. |
| flags | number | Yes| Trace flag combination. For details, see [HiTraceFlag](#hitraceflag). |
**Return Value**
| Type| Description|
| Type | Description |
| -------- | -------- |
| [HiTraceId](#hitraceid) | **HiTraceId** instance.|
| [HiTraceId](#hitraceid) | **HiTraceId** instance. |
**Example**
......@@ -104,9 +104,9 @@ Stops call chain tracing. This API works in synchronous manner.
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.|
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance. |
**Example**
......@@ -126,9 +126,9 @@ Obtains the trace ID. This API works in synchronous manner.
**Return Value**
| Type| Description|
| Type | Description |
| -------- | -------- |
| [HiTraceId](#hitraceid) | **HiTraceId** instance.|
| [HiTraceId](#hitraceid) | **HiTraceId** instance. |
**Example**
......@@ -148,9 +148,9 @@ Sets a trace ID. This API works in synchronous manner.
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.|
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance. |
**Example**
......@@ -186,9 +186,9 @@ Creates a trace span. This API works in synchronous manner.
**Return Value**
| Type| Description|
| Type | Description |
| -------- | -------- |
| [HiTraceId](#hitraceid) | **HiTraceId** instance.|
| [HiTraceId](#hitraceid) | **HiTraceId** instance. |
**Example**
......@@ -208,12 +208,12 @@ Triggers a trace point. This API works in synchronous manner.
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| mode | [HiTraceCommunicationMode](#hitracecommunicationmode) | Yes| Communication mode for the trace point.|
| type | [HiTraceTracepointType](#hitracetracepointtype)| Yes| Trace point type.|
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance for trace point triggering.|
| msg | string | No| Trace description passed for trace point triggering.|
| mode | [HiTraceCommunicationMode](#hitracecommunicationmode) | Yes| Communication mode for the trace point. |
| type | [HiTraceTracepointType](#hitracetracepointtype)| Yes| Trace point type. |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance for trace point triggering. |
| msg | string | No| Trace description passed for trace point triggering. |
**Example**
......@@ -233,15 +233,15 @@ Checks whether a **HiTraceId** instance is valid. This API works in synchronous
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.|
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance. |
**Return Value**
| Type| Description|
| Type | Description |
| -------- | -------- |
| boolean | Returns **true** if the **HiTraceId** instance is valid; returns **false** otherwise.|
| boolean | Returns **true** if the **HiTraceId** instance is valid; returns **false** otherwise. |
**Example**
......@@ -260,16 +260,16 @@ Checks whether the specified trace flag in the **HiTraceId** instance is enabled
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.|
| flag | [HiTraceFlag](#hitraceflag) | Yes| Specified trace flag.|
| id | [HiTraceId](#hitraceid) | Yes | **HiTraceId** instance. |
| flag | [HiTraceFlag](#hitraceflag) | Yes | Specified trace flag. |
**Return Value**
| Type| Description|
| Type | Description |
| -------- | -------- |
| boolean | Returns **true** if the specified trace flag in the **HiTraceId** instance is enabled; returns **false** otherwise.|
| boolean | Returns **true** if the specified trace flag in the **HiTraceId** instance is enabled; returns **false** otherwise. |
**Example**
......@@ -288,10 +288,10 @@ Enables the specified trace flag in the **HiTraceId** instance. This API works i
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters**
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| id | [HiTraceId](#hitraceid) | Yes| **HiTraceId** instance.|
| flag | [HiTraceFlag](#hitraceflag) | Yes| Specified trace flag.|
| id | [HiTraceId](#hitraceid) | Yes | **HiTraceId** instance. |
| flag | [HiTraceFlag](#hitraceflag) | Yes | Specified trace flag. |
**Example**
......@@ -300,4 +300,4 @@ let asyncTraceId = hiTraceChain.begin("business", hiTraceChain.HiTraceFlag.INCLU
hiTraceChain.enable(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
// The value of enabledDoNotCreateSpanFlag is true.
let enabledDoNotCreateSpanFlag = hiTraceChain.isFlagEnabled(asyncTraceId, hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN);
```
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册