harmony 鸿蒙log

  • 2022-08-09
  • 浏览 (631)

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 Guidelines

  • This command can be used only after LOSCFG_SHELL_LK is enabled. Before using this command, set Enable Shell lk to Yes on menuconfig. Debug —> Enable a Debug Version —> Enable Shell —> Enable Shell lK

  • The log level command sets 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 displays the current log level and how to use it.

  • If the log level is set to 4 or 5 in the source code of an OpenHarmony small system, a large number of logs will be printed.

Example

Run log level 3.

Output

The log print level is set to WARN.

OHOS # log level 3
Set current log level WARN

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Kernel

harmony 鸿蒙Kernel Coding Specification

harmony 鸿蒙Standard Libraries

harmony 鸿蒙Interrupt Management

harmony 鸿蒙Event

harmony 鸿蒙Mutex

harmony 鸿蒙Queue

harmony 鸿蒙Semaphore

harmony 鸿蒙Doubly Linked List

harmony 鸿蒙Memory Management

0  赞