Skip to content

Commit f695ddc

Browse files
pippocaoclaude
andcommitted
v2.3.0: OpenHarmony compatibility + Recovery hardening
- Replace ES2020 0n BigInt literals with BigInt(0) in the TypeScript wrapper so the same bqlog package on ohpm works on OpenHarmony 4.1+ (API 11+) as well as HarmonyOS NEXT - no separate package needed. - Strengthen data validation during recovery to detect malformed entries earlier and avoid potential crashes when consuming a corrupted ring buffer. - Bump version to 2.3.0; refresh README/CHANGELOG and integration guide to note HarmonyOS / OpenHarmony share the same package. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dbddce0 commit f695ddc

12 files changed

Lines changed: 53 additions & 41 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [v2.3.0] - 2026-06-03
4+
- **OpenHarmony compatibility**: Replaced ES2020 `0n` BigInt literals with `BigInt(0)` in the TypeScript wrapper so the same `bqlog` package on ohpm works on **OpenHarmony 4.1+ (API 11+)** as well as HarmonyOS NEXT — no separate package needed.
5+
- **Recovery hardening**: Strengthened data validation during recovery to detect malformed entries earlier and avoid potential crashes when consuming a corrupted ring buffer.
6+
37
## [v2.2.9] - 2026-05-06
48
- **Compatibility**: Improved code compatibility with earlier Clang toolchains and frameworks such as MFC.
59
- **Compatibility**: Improved code compatibility across all supported Unreal Engine versions.

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<img src="banner.jpg" alt="BqLog Banner" width="100%">
33
</p>
44

5-
# BqLog (BianQue Log) V 2.2.9
5+
# BqLog (BianQue Log) V 2.3.0
66

77
**English** | [简体中文](./README_CHS.md)
88

99
[![license](https://img.shields.io/badge/license-APACHE2.0-brightgreen.svg?style=flat)](LICENSE.txt)
10-
[![Release Version](https://img.shields.io/badge/release-2.2.9-red.svg)](https://github.com/Tencent/BqLog/releases)
11-
[![ChangeLog](https://img.shields.io/badge/📋_ChangeLog-v2.2.9-orange.svg?style=flat)](CHANGELOG.md)
10+
[![Release Version](https://img.shields.io/badge/release-2.3.0-red.svg)](https://github.com/Tencent/BqLog/releases)
11+
[![ChangeLog](https://img.shields.io/badge/📋_ChangeLog-v2.3.0-orange.svg?style=flat)](CHANGELOG.md)
1212
[![GitHub Stars](https://img.shields.io/github/stars/Tencent/BqLog?style=flat&logo=github)](https://github.com/Tencent/BqLog/stargazers)
1313
[![GitHub Forks](https://img.shields.io/github/forks/Tencent/BqLog?style=flat&logo=github)](https://github.com/Tencent/BqLog/network/members)
1414
[![GitHub Issues](https://img.shields.io/github/issues/Tencent/BqLog?style=flat&logo=github)](https://github.com/Tencent/BqLog/issues)
15-
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux%20%7C%20iOS%20%7C%20Android%20%7C%20HarmonyOS%20%7C%20Unix-lightgrey.svg?style=flat)]()
15+
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux%20%7C%20iOS%20%7C%20Android%20%7C%20HarmonyOS%20%7C%20OpenHarmony%20%7C%20Unix-lightgrey.svg?style=flat)]()
1616
[![Language](https://img.shields.io/badge/language-C%2B%2B%20%7C%20Java%20%7C%20C%23%20%7C%20Kotlin%20%7C%20TypeScript%20%7C%20Python-blue.svg?style=flat)]()
1717

1818
> BqLog is a lightweight, high-performance, industrial-grade logging system that has been widely used in online projects such as "Honor of Kings".
@@ -22,12 +22,12 @@
2222
2323
---
2424

25-
[![Download](https://img.shields.io/badge/⬇_Download-Release_2.2.9-blue.svg?style=for-the-badge)](https://github.com/Tencent/BqLog/releases/tag/Release_2.2.9)
25+
[![Download](https://img.shields.io/badge/⬇_Download-Release_2.3.0-blue.svg?style=for-the-badge)](https://github.com/Tencent/BqLog/releases/tag/Release_2.3.0)
2626

27-
## 📋 What's New in v2.2.9
27+
## 📋 What's New in v2.3.0
2828

29-
- **Compatibility**Improved code compatibility with earlier Clang toolchains and frameworks such as MFC.
30-
- **Compatibility**Improved code compatibility across all supported Unreal Engine versions.
29+
- **OpenHarmony compatibility**Replaced `0n` BigInt literals with `BigInt(0)` in the TypeScript wrapper. The same `bqlog` package on ohpm now works on **OpenHarmony 4.1+ (API 11+)** as well as HarmonyOS NEXT.
30+
- **Recovery hardening**Strengthened data validation during recovery to detect malformed entries earlier and avoid potential crashes when consuming a corrupted ring buffer.
3131

3232
> Full changelog → [CHANGELOG.md](CHANGELOG.md)
3333
@@ -67,7 +67,7 @@
6767

6868
| Platforms | Languages |
6969
|-----------|-----------|
70-
| Windows 64-bit, macOS, Linux (incl. embedded), iOS, Android, HarmonyOS, Unix (FreeBSD, NetBSD, OpenBSD, Solaris, etc.) | C++ (C++11+), Java / Kotlin, C# (Unity, .NET), ArkTS / C++ (HarmonyOS), JavaScript / TypeScript (Node.js), Python 3.7+, Unreal Engine (UE4 & UE5) |
70+
| Windows 64-bit, macOS, Linux (incl. embedded), iOS, Android, HarmonyOS, OpenHarmony, Unix (FreeBSD, NetBSD, OpenBSD, Solaris, etc.) | C++ (C++11+), Java / Kotlin, C# (Unity, .NET), ArkTS / C++ (HarmonyOS & OpenHarmony share the same package), JavaScript / TypeScript (Node.js), Python 3.7+, Unreal Engine (UE4 & UE5) |
7171

7272
**Hardware architectures**: x86, x86_64, ARM32, ARM64
7373
**Integration methods**: Dynamic library, Static library, Source code
@@ -160,7 +160,9 @@ my_log.info("Hello from Python! params: {}, {}", "text", 123)
160160
log.force_flush_all_logs()
161161
```
162162

163-
### TypeScript (HarmonyOS ArkTS)
163+
### TypeScript (HarmonyOS / OpenHarmony ArkTS)
164+
165+
> The same `bqlog` package on ohpm works for both **HarmonyOS** (NEXT) and **OpenHarmony** (4.1+ / API 11+). Same install, same import, same code.
164166
165167
```typescript
166168
import { bq } from "bqlog";
@@ -169,7 +171,7 @@ const config = `
169171
appenders_config.console.levels=[all]
170172
`;
171173
const log = bq.log.create_log("ohos_log", config);
172-
log.info("Hello from HarmonyOS! params: {}, {}", "text", 123);
174+
log.info("Hello from HarmonyOS / OpenHarmony! params: {}, {}", "text", 123);
173175
bq.log.force_flush_all_logs();
174176
```
175177

README_CHS.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<img src="banner.jpg" alt="BqLog Banner" width="100%">
33
</p>
44

5-
# BqLog (扁鹊日志) V 2.2.9
5+
# BqLog (扁鹊日志) V 2.3.0
66

77
[English](./README.md) | **简体中文**
88

99
[![license](https://img.shields.io/badge/license-APACHE2.0-brightgreen.svg?style=flat)](LICENSE.txt)
10-
[![Release Version](https://img.shields.io/badge/release-2.2.9-red.svg)](https://github.com/Tencent/BqLog/releases)
11-
[![ChangeLog](https://img.shields.io/badge/📋_更新日志-v2.2.9-orange.svg?style=flat)](CHANGELOG.md)
10+
[![Release Version](https://img.shields.io/badge/release-2.3.0-red.svg)](https://github.com/Tencent/BqLog/releases)
11+
[![ChangeLog](https://img.shields.io/badge/📋_更新日志-v2.3.0-orange.svg?style=flat)](CHANGELOG.md)
1212
[![GitHub Stars](https://img.shields.io/github/stars/Tencent/BqLog?style=flat&logo=github)](https://github.com/Tencent/BqLog/stargazers)
1313
[![GitHub Forks](https://img.shields.io/github/forks/Tencent/BqLog?style=flat&logo=github)](https://github.com/Tencent/BqLog/network/members)
1414
[![GitHub Issues](https://img.shields.io/github/issues/Tencent/BqLog?style=flat&logo=github)](https://github.com/Tencent/BqLog/issues)
15-
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux%20%7C%20iOS%20%7C%20Android%20%7C%20HarmonyOS%20%7C%20Unix-lightgrey.svg?style=flat)]()
15+
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux%20%7C%20iOS%20%7C%20Android%20%7C%20HarmonyOS%20%7C%20OpenHarmony%20%7C%20Unix-lightgrey.svg?style=flat)]()
1616
[![Language](https://img.shields.io/badge/language-C%2B%2B%20%7C%20Java%20%7C%20C%23%20%7C%20Kotlin%20%7C%20TypeScript%20%7C%20Python-blue.svg?style=flat)]()
1717

1818
> BqLog 是一个轻量级、高性能的工业级日志系统,已在线上广泛应用于《王者荣耀》等项目。
@@ -22,12 +22,12 @@
2222
2323
---
2424

25-
[![Download](https://img.shields.io/badge/⬇_下载-Release_2.2.9-blue.svg?style=for-the-badge)](https://github.com/Tencent/BqLog/releases/tag/Release_2.2.9)
25+
[![Download](https://img.shields.io/badge/⬇_下载-Release_2.3.0-blue.svg?style=for-the-badge)](https://github.com/Tencent/BqLog/releases/tag/Release_2.3.0)
2626

27-
## 📋 v2.2.9 更新亮点
27+
## 📋 v2.3.0 更新亮点
2828

29-
- **兼容性优化**改进对早期 Clang 工具链以及 MFC 等框架的代码兼容性
30-
- **兼容性优化**完善对 Unreal Engine 各版本的代码兼容性
29+
- **OpenHarmony 兼容性**把 TypeScript Wrapper 中的 `0n` BigInt 字面量替换为 `BigInt(0)`,ohpm 上同一个 `bqlog` 包现已可在 **OpenHarmony 4.1+(API 11+)** 和 HarmonyOS NEXT 上通用,无需单独发包
30+
- **Recovery 加固**强化 Recovery 过程中的数据校验,能更早识别异常 entry,避免读取损坏 ring buffer 时潜在的 Crash
3131

3232
> 完整更新日志 → [CHANGELOG.md](CHANGELOG.md)
3333
@@ -68,7 +68,7 @@
6868

6969
| 平台 | 语言 |
7070
|------|------|
71-
| Windows 64-bit、macOS、Linux(含嵌入式)、iOS、Android、HarmonyOS、Unix(FreeBSD、NetBSD、OpenBSD、Solaris 等) | C++(C++11+)、Java / Kotlin、C#(Unity、.NET)、ArkTS / C++(HarmonyOS)、JavaScript / TypeScript(Node.js)、Python 3.7+、Unreal Engine(UE4 & UE5) |
71+
| Windows 64-bit、macOS、Linux(含嵌入式)、iOS、Android、HarmonyOS、OpenHarmony、Unix(FreeBSD、NetBSD、OpenBSD、Solaris 等) | C++(C++11+)、Java / Kotlin、C#(Unity、.NET)、ArkTS / C++(HarmonyOS 与 OpenHarmony 同一份包)、JavaScript / TypeScript(Node.js)、Python 3.7+、Unreal Engine(UE4 & UE5) |
7272

7373
**硬件架构**:x86、x86_64、ARM32、ARM64
7474
**引入方式**:动态库、静态库、源代码
@@ -161,7 +161,9 @@ my_log.info("Hello from Python! params: {}, {}", "text", 123)
161161
log.force_flush_all_logs()
162162
```
163163

164-
### TypeScript (鸿蒙 ArkTS)
164+
### TypeScript (鸿蒙 / OpenHarmony ArkTS)
165+
166+
> 同一个 ohpm 上的 `bqlog` 包同时适用于 **HarmonyOS**(NEXT)和 **OpenHarmony**(4.1+ / API 11+)。安装、引用、API 完全一致。
165167
166168
```typescript
167169
import { bq } from "bqlog";
@@ -170,7 +172,7 @@ const config = `
170172
appenders_config.console.levels=[all]
171173
`;
172174
const log = bq.log.create_log("ohos_log", config);
173-
log.info("Hello from HarmonyOS! params: {}, {}", "text", 123);
175+
log.info("Hello from HarmonyOS / OpenHarmony! params: {}, {}", "text", 123);
174176
bq.log.force_flush_all_logs();
175177
```
176178

demo/nodejs/src/demo_category_log.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@
132132
if (result.get_categories_count() != demo_category_log.categories_count) {
133133
console.log("expected:" + demo_category_log.categories_count + ", but:" + result.get_categories_count());
134134

135-
return new demo_category_log(0n);
135+
return new demo_category_log(BigInt(0));
136136
}
137137
for (let i = 0; i < result.get_categories_count(); ++i) {
138138
if (demo_category_log.category_names[i] != demo_category_log.category_names[i]) {
139-
return new demo_category_log(0n);
139+
return new demo_category_log(BigInt(0));
140140
}
141141
}
142142
return result;

docs/INTEGRATION_GUIDE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
173173

174174
---
175175

176-
## HarmonyOS (ArkTS / C++)
176+
## HarmonyOS / OpenHarmony (ArkTS / C++)
177+
178+
> **HarmonyOS NEXT** and **OpenHarmony** (4.1+ / API 11+) share the **same** `bqlog` package on ohpm. The native `.so` is binary-compatible across both runtimes, and the ArkTS wrapper uses only common APIs. No separate package or build is needed.
177179
178180
### Integration
179181

@@ -201,7 +203,7 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
201203
}
202204
```
203205

204-
Supports direct calling from ArkTS side, also supports calling from Native C++ side.
206+
Supports direct calling from ArkTS side, also supports calling from Native C++ side. Works identically on HarmonyOS NEXT and OpenHarmony.
205207

206208
### C++ (Native) usage
207209

docs/INTEGRATION_GUIDE_CHS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
174174

175175
---
176176

177-
## HarmonyOS(ArkTS / C++)
177+
## HarmonyOS / OpenHarmony(ArkTS / C++)
178+
179+
> **HarmonyOS NEXT****OpenHarmony**(4.1+ / API 11+)共用 ohpm 上**同一个** `bqlog` 包:底层 `.so` 在两边二进制兼容,ArkTS Wrapper 只用公共 API,**不需要单独发包或单独配置**
178180
179181
### 集成方式
180182

@@ -202,7 +204,7 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
202204
}
203205
```
204206

205-
支持在 ArkTS 侧直接调用,也支持在 Native C++ 侧调用。
207+
支持在 ArkTS 侧直接调用,也支持在 Native C++ 侧调用。**HarmonyOS NEXT 和 OpenHarmony 上行为一致,使用方式完全相同。**
206208

207209
### C++(Native)使用方式
208210

src/bq_log/global/version.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
#include "bq_log/global/version.h"
1212
namespace bq {
13-
const char* const BQ_LOG_VERSION = "2.2.9";
13+
const char* const BQ_LOG_VERSION = "2.3.0";
1414

1515
const char* get_bq_log_version()
1616
{

test/typescript/src/bq/test/test_category_log.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@
102102
if (result.get_categories_count() != test_category_log.categories_count) {
103103
console.log("expected:" + test_category_log.categories_count + ", but:" + result.get_categories_count());
104104

105-
return new test_category_log(0n);
105+
return new test_category_log(BigInt(0));
106106
}
107107
for (let i = 0; i < result.get_categories_count(); ++i) {
108108
if (test_category_log.category_names[i] != test_category_log.category_names[i]) {
109-
return new test_category_log(0n);
109+
return new test_category_log(BigInt(0));
110110
}
111111
}
112112
return result;

test/typescript/src/bq/test/test_log_2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class test_log_2 extends test_base {
7474
`);
7575
bq.log.set_console_buffer_enable(false);
7676
bq.log.register_console_callback((log_id: bigint, category_idx: number, log_level: any, content: string) => {
77-
if(log_id != 0n)
77+
if(log_id != BigInt(0))
7878
{
7979
result.add_result(log_id == log_inst_console.get_id(), "console callback test 1");
8080
result.add_result(log_level == bq.log_level.debug, "console callback test 2");

wrapper/typescript/src/bq/category_log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class category_log extends log {
4747
*/
4848
protected static call_api_create_category_log(name: string, config: string, categories_count: number, categories: string[] | null): bigint {
4949
if (!config || config.length == 0) {
50-
return 0n;
50+
return BigInt(0);
5151
}
5252
let log_handle: bigint = log_invoker.__api_create_log(name, config, categories_count, categories);
5353
return log_handle;

0 commit comments

Comments
 (0)