diff --git a/README.md b/README.md index c43ec4fcbad56a6d2588050bcb3132fd0d333966..1d01b7d5dacfae4e7ff8681e0a36ca79f8ffe215 100644 --- a/README.md +++ b/README.md @@ -1,74 +1,76 @@ -# HiLog +# HiLog组件 -- [Introduction](#section11660541593) -- [Directory Structure](#section161941989596) -- [Constraints](#section119744591305) -- [Usage](#section06487425716) - - [Available APIs](#section1551164914237) - - [Usage Guidelines](#section129654513264) +- [HiLog组件](#hilog组件) + - [简介](#简介) + - [目录](#目录) + - [约束](#约束) + - [说明](#说明) + - [接口说明](#接口说明) + - [使用说明](#使用说明) + - [涉及仓](#涉及仓) -- [Repositories Involved](#section177639411669) +- [涉及仓](#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. +HiLog是OpenHarmony日志系统,提供给系统框架、服务、以及应用打印日志,记录用户操作、系统运行状态等。 -**Figure 1** Architecture of the HiLog module +**图 1** HiLog架构图 - + -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. +用户态Process通过日志接口将日志内容写入hilogd buffer中,用户态的hilog工具支持将输出到控制台(console)进行查看,同时也支持通过hilog工具给hilogd发送命令将日志落盘。 -The details are as follows: +下述主要任务的详细内容: -- **hilogd**: log service in the user space +- hilogd是流水日志的用户态服务。 -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. +1. 此功能是常驻服务,在研发版本系统启动时默认启动。 +2. 当用户态模块调用日志接口,将格式化好的日志内容传输给该任务,并将其存储在一个环形缓冲区中 。 -- **hilog**: command line tool for viewing logs +- hilog日志查看命令行工具 -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. +1. 从hilogd读取ringbuffer内容,输出到标准输出,可支持日志过滤。 -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 +- 支持参数隐私标识格式化(详见下面举例)。 +- 支持对超标日志打印进程流控。 +- 支持对超标日志打印domain\(标识子系统/模块\)流控。 +- 支持流压缩落盘。 -## 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 +├── frameworks # 框架代码 +│ └── native # HiLog native实现代码 +├── interfaces # 接口 +│ └── native # 对外C/C++接口 +│ └── innerkits # 对内部子系统暴露的头文件 +│ └── kits # 对应用暴露的头文件 ├── services -│ └── hilogd # HiLog resident service implementation -│ └── hilogtool # HiLog tool implementation +│ └── hilogd # 日志常驻服务实现 +│ └── hilogtool # 日志工具实现 ``` -## Constraints +## 约束 -Clang 8.0.0 or later is required. +依赖 Clang 编译器\(**Clang** 8.0.0 \)及以上。 -## Usage +## 说明 -### Available APIs +### 接口说明 -**Table 1** Major APIs of HiLog +**表 1** 主要API说明 -