# log ## Command Function This command is used to set and query log configuration. ## Syntax log level \[_levelNum_\] ## Parameters **Table 1** Parameter description

Parameter

Description

Value Range

levelNum

Specifies the level of logs to print.

[0,5]

## Usage - This command depends on **LOSCFG\_SHELL\_LK**. Before using this command, select **Enable Shell lk** on **menuconfig**. **Debug** ---\> **Enable a Debug Version** ---\> **Enable Shell** ---\> **Enable Shell lK** - The **log level** command is used to set the log level, which can be any of the following: TRACE\_EMG = 0, TRACE\_COMMON = 1, TRACE\_ERROR = 2, TRACE\_WARN = 3, TRACE\_INFO = 4, TRACE\_DEBUG = 5 If the log level specified is not within the value range, a message will be displayed. - If **\[levelNum\]** is not specified, this command queries the current log level. The usage method is also displayed. - 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. ## Example Run **log level 3**. ## Output Setting the log print level to WARN: ``` OHOS # log level 3 Set current log level WARN ```