@pippocao/bqlog 2.2.4 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pippocao/bqlog",
3
- "version": "2.2.4",
3
+ "version": "2.2.7",
4
4
  "description": "High-performance cross-platform logging library for Node.js, with native C++ core. Supports sync/async modes, compressed file appenders, category logging, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "pippocao",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/README.ohos.md DELETED
@@ -1,163 +0,0 @@
1
- # BqLog
2
-
3
- > **工业级高性能日志引擎** -- 基于原生 C++ 无锁环形缓冲区核心,经过腾讯大规模游戏引擎和APP的生产验证,现已支持 HarmonyOS (ArkTS)。
4
-
5
- [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](https://www.apache.org/licenses/LICENSE-2.0)
6
-
7
- 项目主页:[github.com/Tencent/BqLog](https://github.com/Tencent/BqLog)
8
-
9
-
10
- ---
11
- ## 💡 如果您有以下困扰,可以尝试 BqLog
12
-
13
- - 如果您的客户端产品(尤其是游戏)希望同时满足以下「不可能三角」:
14
- - 方便追溯问题(日志应写尽写)
15
- - 性能足够好(日志要少写)
16
- - 节约存储空间(日志最好就别写)
17
- - 如果您是后台服务开发者,现有日志库在**高并发场景**下性能不足,导致日志丢失或程序阻塞。
18
- - 如果您的编程语言是 C++、Java、C#、Kotlin、TypeScript、JavaScript、Python 之一,或者同时使用多种语言,希望有一套**统一的跨语言日志解决方案**。
19
-
20
- ---
21
-
22
- ## 特性
23
-
24
- - **极致性能** -- 工业级无锁队列,对UTF16环境极致优化
25
- - **工业级品质** -- 腾讯生产环境上亿用户验证,适用于游戏引擎(Unity、Unreal)、移动应用及高并发服务端
26
- - **压缩加密 Appender** -- `compressed_file` 生成最小体积的日志文件,几乎零开销,支持 RSA + AES 混合非对称加密
27
- - **同步与异步模式** -- 按需选择线程模型,平衡延迟与吞吐
28
- - **分类日志** -- 为日志条目附加分类标签,支持分类掩码过滤
29
- - **崩溃恢复** -- 内存映射缓冲区可在进程崩溃后存活,未刷写的日志在重启时自动恢复
30
- - **跨平台** -- 支持 Windows、macOS、Linux、Android、iOS、HarmonyOS 等多平台
31
-
32
- ---
33
-
34
- ## 安装
35
-
36
- ```
37
- ohpm install bqlog
38
- ```
39
-
40
- ---
41
-
42
- ## 快速开始
43
-
44
- ```typescript
45
- import { bq } from "bqlog";
46
-
47
- const config = `
48
- appenders_config.console.type=console
49
- appenders_config.console.levels=[all]
50
- `;
51
- const log = bq.log.create_log("my_log", config);
52
-
53
- log.info("Hello BqLog! int:{}, float:{}", 123, 3.14);
54
- bq.log.force_flush_all_logs();
55
- ```
56
-
57
- ---
58
-
59
- ## Appender 类型
60
-
61
- | 类型 | 说明 |
62
- |------|------|
63
- | `console` | 输出到 stdout/stderr |
64
- | `text_file` | 纯文本日志文件,可直接阅读 |
65
- | `compressed_file` | **二进制压缩 -- 体积最小、写入最快,可选 RSA+AES 加密。** 使用 BqLog 解码工具解码 |
66
-
67
- ---
68
-
69
- ## 压缩加密 Appender
70
-
71
- `compressed_file` 是 **生产环境推荐选择**:
72
-
73
- - **最小输出** -- 专有二进制格式,文件体积远小于纯文本或 gzip
74
- - **最快写入** -- 压缩集成在写入路径中,几乎无额外开销
75
- - **混合加密** -- 可选 RSA + AES 加密保护静态日志内容,加密几乎不影响性能
76
-
77
- ```typescript
78
- const config = `
79
- appenders_config.SecureFile.type=compressed_file
80
- appenders_config.SecureFile.time_zone=localtime
81
- appenders_config.SecureFile.levels=[all]
82
- appenders_config.SecureFile.file_name=logs/secure
83
- appenders_config.SecureFile.max_file_size=100000000
84
- appenders_config.SecureFile.expire_time_days=30
85
-
86
- # 可选:启用加密(提供 RSA 公钥)
87
- # appenders_config.SecureFile.pub_key=your_rsa_public_key_here
88
-
89
- log.thread_mode=async
90
- `;
91
- const log = bq.log.create_log("secure_log", config);
92
- log.info("此日志已压缩,可选加密");
93
- ```
94
-
95
- ---
96
-
97
- ## 配置示例
98
-
99
- ```typescript
100
- const config = `
101
- appenders_config.ConsoleAppender.type=console
102
- appenders_config.ConsoleAppender.time_zone=localtime
103
- appenders_config.ConsoleAppender.levels=[all]
104
-
105
- appenders_config.FileAppender.type=compressed_file
106
- appenders_config.FileAppender.time_zone=localtime
107
- appenders_config.FileAppender.levels=[info,warning,error,fatal]
108
- appenders_config.FileAppender.file_name=logs/app
109
- appenders_config.FileAppender.max_file_size=100000000
110
- appenders_config.FileAppender.expire_time_days=7
111
-
112
- log.thread_mode=async
113
- `;
114
- const log = bq.log.create_log("app", config);
115
- ```
116
-
117
- ---
118
-
119
- ## 分类日志
120
-
121
- 使用 [BqLog Category Generator](https://github.com/Tencent/BqLog/tree/main/tools/category_log_generator) 工具生成类型安全的分类日志封装:
122
-
123
- ```typescript
124
- import { my_category_log } from "./my_category_log";
125
-
126
- const log = my_category_log.create_log("cat_log", config);
127
- log.info(log.cat.ModuleA.SystemA, "分类消息: {}", value);
128
- ```
129
-
130
- ---
131
-
132
- ## 日志级别
133
-
134
- | 级别 | 用途 |
135
- |------|------|
136
- | `verbose` | 细粒度追踪 |
137
- | `debug` | 调试信息 |
138
- | `info` | 常规运行消息 |
139
- | `warning` | 潜在问题 |
140
- | `error` | 错误状况 |
141
- | `fatal` | 严重故障 |
142
-
143
- ---
144
-
145
- ## 基准测试
146
-
147
- BqLog 的性能持续领先于主流日志库。详细基准测试结果请参阅主仓库:[完整测试数据](https://github.com/Tencent/BqLog#benchmark)。
148
-
149
- ---
150
-
151
- ## 完整文档
152
-
153
- 支持所有语言的完整文档和示例:
154
-
155
- **C++ | Java | C# | Python | TypeScript | Unreal Engine | Unity | HarmonyOS**
156
-
157
- 👉 **[github.com/Tencent/BqLog](https://github.com/Tencent/BqLog)**
158
-
159
- ---
160
-
161
- ## 许可证
162
-
163
- [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) -- 可免费商用。
File without changes