kernel-small-debug-shell-cmd-log.md 2.8 KB
Newer Older
D
duangavin123 已提交
1
# log<a name="EN-US_TOPIC_0000001133846474"></a>
W
wenjun 已提交
2

N
NEEN 已提交
3 4
-   [Command Function](#section128219131856)
-   [Syntax](#section3894181710519)
D
duangavin123 已提交
5
-   [Parameters](#section7693122310515)
N
NEEN 已提交
6 7 8 9
-   [Usage](#section1982111281512)
-   [Example](#section176301333259)
-   [Output](#section14354765415)

W
wenjun 已提交
10 11 12 13 14 15 16 17
## Command Function<a name="section128219131856"></a>

This command is used to modify and query log configurations.

## Syntax<a name="section3894181710519"></a>

log level \[_levelNum_\]

D
duangavin123 已提交
18
## Parameters<a name="section7693122310515"></a>
W
wenjun 已提交
19

D
duangavin123 已提交
20
**Table  1**  Parameter description
W
wenjun 已提交
21 22 23 24 25 26 27 28 29 30 31 32

<a name="table237mcpsimp"></a>
<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>
</th>
<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>
</th>
<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>
</th>
</tr>
</thead>
<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>
</td>
D
duangavin123 已提交
33
<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 print level of logs.</p>
W
wenjun 已提交
34 35 36 37 38 39 40 41 42
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p256mcpsimp"><a name="p256mcpsimp"></a><a name="p256mcpsimp"></a>[0x0, 0x5]</p>
</td>
</tr>
</tbody>
</table>

## Usage<a name="section1982111281512"></a>

D
duangavin123 已提交
43
-   This command depends on  **LOSCFG\_SHELL\_LK**. Before using this command, select  **Enable Shell lk**  on  **menuconfig**.
W
wenjun 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

    Debug ---\> Enable a Debug Version ---\> Enable Shell ---\> Enable Shell lK

-   The  **log level**  command is used to configure log levels, which can be:

    TRACE\_EMG = 0,

    TRACE\_COMMON = 1,

    TRACE\_ERROR = 2,

    TRACE\_WARN = 3,

    TRACE\_INFO = 4,

    TRACE\_DEBUG = 5

D
duangavin123 已提交
61
    If the level is not within the valid range, a message will be displayed.
W
wenjun 已提交
62 63 64 65 66

-   If the  **\[levelNum\]**  parameter is not specified, the current log level and its usage are printed by default.

## Example<a name="section176301333259"></a>

D
duangavin123 已提交
67 68 69
Example:

Run  **log level 4**.
W
wenjun 已提交
70 71 72

## Output<a name="section14354765415"></a>

D
duangavin123 已提交
73
![](figure/en-us_image_0000001179847649.png)
W
wenjun 已提交
74