@midscene/shared 0.14.2 → 0.14.3-beta-20250409031306.0
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/dist/es/logger.js +4 -1
- package/dist/lib/logger.js +4 -1
- package/package.json +1 -1
- package/src/logger.ts +5 -1
package/dist/es/logger.js
CHANGED
|
@@ -43,7 +43,10 @@ function writeLogToFile(topic, message) {
|
|
|
43
43
|
function getDebug(topic) {
|
|
44
44
|
return (...args) => {
|
|
45
45
|
const message = args.map(
|
|
46
|
-
(arg) => typeof arg === "object" ? JSON.stringify(
|
|
46
|
+
(arg) => typeof arg === "object" ? JSON.stringify(
|
|
47
|
+
arg,
|
|
48
|
+
(key, value) => typeof value === "bigint" ? `${value.toString()}n` : value
|
|
49
|
+
) : String(arg)
|
|
47
50
|
).join(" ");
|
|
48
51
|
if (isNodeEnv) {
|
|
49
52
|
writeLogToFile(topic, message);
|
package/dist/lib/logger.js
CHANGED
|
@@ -79,7 +79,10 @@ function writeLogToFile(topic, message) {
|
|
|
79
79
|
function getDebug(topic) {
|
|
80
80
|
return (...args) => {
|
|
81
81
|
const message = args.map(
|
|
82
|
-
(arg) => typeof arg === "object" ? JSON.stringify(
|
|
82
|
+
(arg) => typeof arg === "object" ? JSON.stringify(
|
|
83
|
+
arg,
|
|
84
|
+
(key, value) => typeof value === "bigint" ? `${value.toString()}n` : value
|
|
85
|
+
) : String(arg)
|
|
83
86
|
).join(" ");
|
|
84
87
|
if (isNodeEnv) {
|
|
85
88
|
writeLogToFile(topic, message);
|
package/package.json
CHANGED
package/src/logger.ts
CHANGED
|
@@ -34,7 +34,11 @@ export function getDebug(topic: string): DebugFunction {
|
|
|
34
34
|
return (...args: unknown[]): void => {
|
|
35
35
|
const message = args
|
|
36
36
|
.map((arg) =>
|
|
37
|
-
typeof arg === 'object'
|
|
37
|
+
typeof arg === 'object'
|
|
38
|
+
? JSON.stringify(arg, (key, value) =>
|
|
39
|
+
typeof value === 'bigint' ? `${value.toString()}n` : value,
|
|
40
|
+
)
|
|
41
|
+
: String(arg),
|
|
38
42
|
)
|
|
39
43
|
.join(' ');
|
|
40
44
|
|