# HiLog - [Introduction](#section11660541593) - [Directory Structure](#section161941989596) - [Constraints](#section119744591305) - [Usage](#section06487425716) - [Available APIs](#section1551164914237) - [Usage Guidelines](#section129654513264) - [Repositories Involved](#section177639411669) ## 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 ![](figures/en-us_image_0000001115534242.png) 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 1. hilogd is a resident service and is enabled by default when the system is started. 2. 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 1. 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. |
||