@pippocao/bqlog 2.2.9 → 2.3.1

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.
@@ -46,7 +46,7 @@ class category_log extends log_1.log {
46
46
  */
47
47
  static call_api_create_category_log(name, config, categories_count, categories) {
48
48
  if (!config || config.length == 0) {
49
- return 0n;
49
+ return BigInt(0);
50
50
  }
51
51
  let log_handle = log_invoker_1.log_invoker.__api_create_log(name, config, categories_count, categories);
52
52
  return log_handle;
@@ -16,7 +16,7 @@ exports.log_invoker = void 0;
16
16
  // For ESM build it is a copy of lib_loader.esm.txt,
17
17
  // for CJS and OHOS build it is lib_loader.ts.
18
18
  const lib_loader_1 = require("../utils/lib_loader");
19
- function as_bigint(v, def = 0n) {
19
+ function as_bigint(v, def = BigInt(0)) {
20
20
  return typeof v === "bigint" ? v : def;
21
21
  }
22
22
  class log_invoker {
@@ -56,7 +56,7 @@ class log {
56
56
  */
57
57
  static create_log(name, config) {
58
58
  if (!config || config.length == 0) {
59
- return new log(0n);
59
+ return new log(BigInt(0));
60
60
  }
61
61
  let log_id = log_invoker_1.log_invoker.__api_create_log(name, config, 0, null);
62
62
  return new log(log_id);
@@ -70,7 +70,7 @@ class log {
70
70
  */
71
71
  static get_log_by_name(log_name) {
72
72
  if (!log_name || log_name.length == 0) {
73
- return new log(0n);
73
+ return new log(BigInt(0));
74
74
  }
75
75
  let log_count = log_invoker_1.log_invoker.__api_get_logs_count();
76
76
  for (let i = 0; i < log_count; ++i) {
@@ -80,14 +80,14 @@ class log {
80
80
  return new log(id);
81
81
  }
82
82
  }
83
- return new log(0n);
83
+ return new log(BigInt(0));
84
84
  }
85
85
  /**
86
86
  * Synchronously flush the buffer of all log objects
87
87
  * to ensure that all data in the buffer is processed after the call.
88
88
  */
89
89
  static force_flush_all_logs() {
90
- log_invoker_1.log_invoker.__api_force_flush(0n);
90
+ log_invoker_1.log_invoker.__api_force_flush(BigInt(0));
91
91
  }
92
92
  /**
93
93
  * Register a callback that will be invoked whenever a console log message is output.
@@ -144,7 +144,7 @@ class log {
144
144
  log_invoker_1.log_invoker.__api_log_device_console(level, str);
145
145
  }
146
146
  constructor(arg) {
147
- this.log_id_ = 0n;
147
+ this.log_id_ = BigInt(0);
148
148
  this.name_ = "";
149
149
  this.categories_name_array_ = [];
150
150
  if (arg instanceof log) {
@@ -163,7 +163,7 @@ class log {
163
163
  this.log_id_ = arg;
164
164
  let name = log_invoker_1.log_invoker.__api_get_log_name_by_id(this.log_id_);
165
165
  if (!name) {
166
- this.log_id_ = 0n;
166
+ this.log_id_ = BigInt(0);
167
167
  return;
168
168
  }
169
169
  this.name_ = name;
@@ -213,7 +213,7 @@ class log {
213
213
  * @return
214
214
  */
215
215
  is_valid() {
216
- return this.get_id() != 0n;
216
+ return this.get_id() != BigInt(0);
217
217
  }
218
218
  /**
219
219
  * Get the name of a log
@@ -43,7 +43,7 @@ export class category_log extends log {
43
43
  */
44
44
  static call_api_create_category_log(name, config, categories_count, categories) {
45
45
  if (!config || config.length == 0) {
46
- return 0n;
46
+ return BigInt(0);
47
47
  }
48
48
  let log_handle = log_invoker.__api_create_log(name, config, categories_count, categories);
49
49
  return log_handle;
@@ -13,7 +13,7 @@
13
13
  // For ESM build it is a copy of lib_loader.esm.txt,
14
14
  // for CJS and OHOS build it is lib_loader.ts.
15
15
  import { native_export } from "../utils/lib_loader.js";
16
- function as_bigint(v, def = 0n) {
16
+ function as_bigint(v, def = BigInt(0)) {
17
17
  return typeof v === "bigint" ? v : def;
18
18
  }
19
19
  export class log_invoker {
@@ -53,7 +53,7 @@ export class log {
53
53
  */
54
54
  static create_log(name, config) {
55
55
  if (!config || config.length == 0) {
56
- return new log(0n);
56
+ return new log(BigInt(0));
57
57
  }
58
58
  let log_id = log_invoker.__api_create_log(name, config, 0, null);
59
59
  return new log(log_id);
@@ -67,7 +67,7 @@ export class log {
67
67
  */
68
68
  static get_log_by_name(log_name) {
69
69
  if (!log_name || log_name.length == 0) {
70
- return new log(0n);
70
+ return new log(BigInt(0));
71
71
  }
72
72
  let log_count = log_invoker.__api_get_logs_count();
73
73
  for (let i = 0; i < log_count; ++i) {
@@ -77,14 +77,14 @@ export class log {
77
77
  return new log(id);
78
78
  }
79
79
  }
80
- return new log(0n);
80
+ return new log(BigInt(0));
81
81
  }
82
82
  /**
83
83
  * Synchronously flush the buffer of all log objects
84
84
  * to ensure that all data in the buffer is processed after the call.
85
85
  */
86
86
  static force_flush_all_logs() {
87
- log_invoker.__api_force_flush(0n);
87
+ log_invoker.__api_force_flush(BigInt(0));
88
88
  }
89
89
  /**
90
90
  * Register a callback that will be invoked whenever a console log message is output.
@@ -141,7 +141,7 @@ export class log {
141
141
  log_invoker.__api_log_device_console(level, str);
142
142
  }
143
143
  constructor(arg) {
144
- this.log_id_ = 0n;
144
+ this.log_id_ = BigInt(0);
145
145
  this.name_ = "";
146
146
  this.categories_name_array_ = [];
147
147
  if (arg instanceof log) {
@@ -160,7 +160,7 @@ export class log {
160
160
  this.log_id_ = arg;
161
161
  let name = log_invoker.__api_get_log_name_by_id(this.log_id_);
162
162
  if (!name) {
163
- this.log_id_ = 0n;
163
+ this.log_id_ = BigInt(0);
164
164
  return;
165
165
  }
166
166
  this.name_ = name;
@@ -210,7 +210,7 @@ export class log {
210
210
  * @return
211
211
  */
212
212
  is_valid() {
213
- return this.get_id() != 0n;
213
+ return this.get_id() != BigInt(0);
214
214
  }
215
215
  /**
216
216
  * Get the name of a log
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pippocao/bqlog",
3
- "version": "2.2.9",
3
+ "version": "2.3.1",
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",
@@ -58,7 +58,7 @@
58
58
  "postpublish": "node -e \"try{require('fs').unlinkSync('README.md')}catch(e){}\""
59
59
  },
60
60
  "devDependencies": {
61
- "@types/node": "^22.19.17",
61
+ "@types/node": "^22.19.21",
62
62
  "typescript": "^5.9.3"
63
63
  },
64
64
  "engines": {
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