• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# log
2
3## Command Function<a name="section128219131856"></a>
4
5This command is used to set and query log configuration.
6
7## Syntax<a name="section3894181710519"></a>
8
9log level \[_levelNum_\]
10
11## Parameters<a name="section7693122310515"></a>
12
13**Table  1**  Parameter description
14
15<a name="table237mcpsimp"></a>
16<table><thead align="left"><tr id="row243mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p245mcpsimp"><a name="p245mcpsimp"></a><a name="p245mcpsimp"></a><strong id="b3369319192013"><a name="b3369319192013"></a><a name="b3369319192013"></a>Parameter</strong></p>
17</th>
18<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.2"><p id="p247mcpsimp"><a name="p247mcpsimp"></a><a name="p247mcpsimp"></a><strong id="b12646112413211"><a name="b12646112413211"></a><a name="b12646112413211"></a>Description</strong></p>
19</th>
20<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p249mcpsimp"><a name="p249mcpsimp"></a><a name="p249mcpsimp"></a><strong id="b13881153318285"><a name="b13881153318285"></a><a name="b13881153318285"></a>Value Range</strong></p>
21</th>
22</tr>
23</thead>
24<tbody><tr id="row250mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p252mcpsimp"><a name="p252mcpsimp"></a><a name="p252mcpsimp"></a>levelNum</p>
25</td>
26<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p254mcpsimp"><a name="p254mcpsimp"></a><a name="p254mcpsimp"></a>Specifies the level of logs to print.</p>
27</td>
28<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p2270121719813"><a name="p2270121719813"></a><a name="p2270121719813"></a>[0,5]</p>
29</td>
30</tr>
31</tbody>
32</table>
33
34## Usage<a name="section1982111281512"></a>
35
36-   This command depends on  **LOSCFG\_SHELL\_LK**. Before using this command, select  **Enable Shell lk**  on  **menuconfig**.
37
38    **Debug**  ---\>  **Enable a Debug Version**  ---\>  **Enable Shell**  ---\>  **Enable Shell lK**
39
40-   The  **log level**  command is used to set the log level, which can be any of the following:
41
42    TRACE\_EMG = 0,
43
44    TRACE\_COMMON = 1,
45
46    TRACE\_ERROR = 2,
47
48    TRACE\_WARN = 3,
49
50    TRACE\_INFO = 4,
51
52    TRACE\_DEBUG = 5
53
54    If the log level specified is not within the value range, a message will be displayed.
55
56-   If  **\[levelNum\]**  is not specified, this command queries the current log level. The usage method is also displayed.
57-   If the log level is set to  **4**  or  **5**  in the source code of the open-source small system, a large number of logs will be printed.
58
59## Example<a name="section176301333259"></a>
60
61Run  **log level 3**.
62
63## Output<a name="section14354765415"></a>
64
65Setting the log print level to WARN:
66
67```
68OHOS # log level 3
69Set current log level WARN
70```
71
72