1 Star 0 Fork 4.9K

丛林 / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
kernel-small-debug-shell-cmd-log.md 2.75 KB
一键复制 编辑 原始数据 按行查看 历史
Annie_wang 提交于 2022-05-19 22:02 . update docs

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
1
https://gitee.com/jungle8023/docs.git
git@gitee.com:jungle8023/docs.git
jungle8023
docs
docs
master

搜索帮助