暂无描述
| Files | Last commit | Last update |
|---|---|---|
| 5 years ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 9 months ago | ||
| 5 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 5 years ago | ||
| 2 years ago | ||
| 4 years ago | ||
| 2 years ago | ||
| 10 months ago | ||
| 3 years ago | ||
| 2 years ago | ||
| 2 years ago |
HiLog
Introduction
HiLog is the module of OpenHarmony that logs information such as user operations and system running status for the system framework, services, and applications.
Figure 1 Architecture of the HiLog module

User-space processes write logs to the ring buffer of hilogd through the log API. hilogd sends logs to the console for viewing or writes logs to the flash at the request of the hilog.
The details are as follows:
- hilogd: log service in the user space
- hilogd is a resident service and is enabled by default when the system is started.
- User-space processes call the log APIs to transfer the formatted log content to hilogd and store the content in its ring buffer.
- hilog: command line tool for viewing logs
- hilog reads the log content from the ring buffer of hilogd, filters the content if required, and then prints the content to the standard output.
Supported functions:
- Formatting of parameter privacy identifiers (See the following example for details.)
- Flow control on excess log processes
- Flow control on excess domains (subsystems or modules) involved in log printing
- Log compression and flushing
Directory Structure
/base/hiviewdfx/hilog
├── frameworks # Framework code
│ └── native # HiLog Native implementation code
├── interfaces # APIs
│ └── native # External C/C++ APIs
│ └── innerkits # Header files opened to internal subsystems
│ └── kits # Header files opened to applications
│ └── js # External js APIs
├── services
│ └── hilogd # HiLog resident service implementation
│ └── hilogtool # HiLog tool implementation
Constraints
Clang 8.0.0 or later is required.
Usage
Available APIs
Table 1 Major APIs of HiLog
Constructs a log label, including the log type, domain, and tag. |
||
Usage Guidelines
- View logs.
Run the hilog | grep "MY_TAG" command in shell mode.
Output in debug mode:
01-26 11:01:06.870 1051 1051 W 00201/test: Failed to visit [https://gitee.com/openharmony](https://gitee.com/openharmony), reason:503.
Output in release mode:
01-26 11:01:06.870 1051 1051 W 00201/test: Failed to visit <private>, reason:503.
Repositories Involved
hiviewdfx_hilog