assistant-guidelines.md 3.7 KB
Newer Older
E
ester.zhou 已提交
1 2 3 4
# Debugging Assistant Usage

The common event and notification module provides debugging tools to facilitate your application development. With these tools, you can view common event and notification information, publish common events, and more. These tools have been integrated with the system. You can run related commands directly in the shell.

E
ester.zhou 已提交
5
## cem Debugging Assistant
E
ester.zhou 已提交
6

E
ester.zhou 已提交
7
### publish
E
ester.zhou 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

* Functionality

  Publishes a common event.

* Usage

  `cem publish [<options>]` 

  The table below describes the available options.

  | Option        | Description                                  |
  | ------------ | ------------------------------------------ |
  | -e/--event   | Indicates the name of the common event to publish. Mandatory.                    |
  | -s/--sticky  | Indicates that the common event to publish is sticky. Optional. By default, non-sticky events are published.|
  | -o/--ordered | Indicates that the common event to publish is ordered. Optional. By default, non-ordered events are published.  |
  | -c/--code    | Indicates the result code of the common event. Optional.                  |
  | -d/--data    | Indicates the data carried in the common event. Optional.                |
  | -h/--help    | Indicates the help Information                                  |

* Example

  `cem publish --event "testevent"`

  Publish a common event named **testevent**.

   ![cem-publish-event](figures/cem-publish-event.png)

  

  `cem publish -e "testevent" -s -o -c 100 -d "this is data" `

  Publish a sticky, ordered common event named **testevent**. The result code of the event is **100** and the data carried is **this is data**.

   ![cem-publish-all](figures/cem-publish-all.png)

E
ester.zhou 已提交
44
### dump
E
ester.zhou 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

* Functionality

  Displays information about common events.

* Usage

  `cem dump [<options>]`

  The table below describes the available options.

  | Option      | Description                                    |
  | ---------- | -------------------------------------------- |
  | -a/--all   | Displays information about all common events that have been sent since system startup.|
  | -e/--event | Displays information about a specific event.                  |
  | -h/--help  | Displays the help information.                                    |

* Example

`cem dump -e "testevent"`

​        Display information about the common event testevent.

​        ![cem-dump-e](figures/cem-dump-e.png)

E
ester.zhou 已提交
70
### help
E
ester.zhou 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85

* Functionality

  Displays the help information.

* Usage

  `cem help`

* Example

    ![cem-help](figures/cem-help.png)



E
ester.zhou 已提交
86
## anm Debugging Assistant
E
ester.zhou 已提交
87

E
ester.zhou 已提交
88
### dump
E
ester.zhou 已提交
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

* Functionality

  Displays information about notifications.

* Usage

  `anm dump [<options>]`

  The table below describes the available options.

  | Option            | Description                                |
  | ---------------- | ---------------------------------------- |
  | -A/--active      | Displays information about all active notifications.                  |
  | -R/--recent      | Displays information about the recent notifications.                      |
  | -D/--distributed | Displays information about distributed notifications from other devices.        |
  | --setRecentCount | Indicates the number of the cached recent notifications to be displayed. Optional.|
  | -h/--help        | Displays the help information.                                |

* Example

  `anm dump -A`

  Displays information about all active notifications.

   ![anm-dump-A](figures/anm-dump-A.png)

  

  `anm dump --setRecentCount  10`

  Set the number of the cached recent notifications to be displayed to 10.

E
ester.zhou 已提交
122
### help
E
ester.zhou 已提交
123 124 125 126 127 128 129 130 131 132 133 134

* Functionality

  Displays the help information.

* Usage

  `anm help`

* Example

 ![anm-help](figures/anm-help.png)