Skip to content

Commit f3a0269

Browse files
committed
bigint support in logger
1 parent ad0a45e commit f3a0269

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/core/src/logger.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,20 @@ class ElizaLogger {
7777
const c = this.#getColor(foregroundColor, backgroundColor);
7878
// turns objects into printable strings
7979
strings = strings.map((item) => {
80-
if (typeof item === "object") item = JSON.stringify(item);
80+
if (typeof item === "object") {
81+
// Handle BigInt serialization
82+
return JSON.stringify(item, (key, value) =>
83+
typeof value === 'bigint'
84+
? value.toString()
85+
: value
86+
);
87+
}
8188
return item;
8289
});
8390
console.log(c, strings.join(""), this.#getColorReset());
8491
if (this.closeByNewLine) console.log("");
8592
}
93+
8694
log(...strings) {
8795
const fg = "white";
8896
const bg = "";

0 commit comments

Comments
 (0)