assistant-guidelines.md 3.9 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
* Function
E
ester.zhou 已提交
10 11 12 13 14 15 16 17 18

  Publishes a common event.

* Usage

  `cem publish [<options>]` 

  The table below describes the available options.

19
  | Option       | Description                                |
E
ester.zhou 已提交
20
  | ------------ | ------------------------------------------ |
21 22 23 24 25 26
  | -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                                                                                 |
E
ester.zhou 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

* 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
* Function
E
ester.zhou 已提交
47 48 49 50 51 52 53 54 55

  Displays information about common events.

* Usage

  `cem dump [<options>]`

  The table below describes the available options.

56
  | Option     | Description                                  |
E
ester.zhou 已提交
57
  | ---------- | -------------------------------------------- |
58 59 60
  | -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.                                                         |
E
ester.zhou 已提交
61 62 63 64 65 66 67 68 69

* 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
* Function
E
ester.zhou 已提交
73 74 75 76 77 78 79 80 81 82 83 84 85

  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
* Function
E
ester.zhou 已提交
91 92 93 94 95 96 97 98 99

  Displays information about notifications.

* Usage

  `anm dump [<options>]`

  The table below describes the available options.

100
  | Option            | Description                             |
E
ester.zhou 已提交
101
  | ---------------- | ---------------------------------------- |
102 103 104 105 106
  | -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.                                                     |
E
ester.zhou 已提交
107 108 109 110 111

* Example

  `anm dump -A`

112
  Display information about all active notifications.
E
ester.zhou 已提交
113 114 115 116 117 118 119

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

  

  `anm dump --setRecentCount  10`

120
  Set the number of the cached recent notifications to be displayed to **10**.
E
ester.zhou 已提交
121

E
ester.zhou 已提交
122
### help
E
ester.zhou 已提交
123

124
* Function
E
ester.zhou 已提交
125 126 127 128 129 130 131 132 133 134

  Displays the help information.

* Usage

  `anm help`

* Example

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