Skip to content

Commit c983da4

Browse files
committed
fix: handle Symbol values in logger formatLogDetail
1 parent 3237cbc commit c983da4

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/util/logger.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ function formatLogDetail(detail: unknown): string {
5353
typeof detail === 'string' ||
5454
typeof detail === 'number' ||
5555
typeof detail === 'boolean' ||
56-
typeof detail === 'bigint'
56+
typeof detail === 'bigint' ||
57+
typeof detail === 'symbol'
5758
) {
5859
return String(detail);
5960
}

test/unit/util/logger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('Logger', () => {
127127
'[agent-terminal] debug: msg 42\n',
128128
'[agent-terminal] debug: msg true\n',
129129
'[agent-terminal] debug: msg [object Object]\n',
130-
'[agent-terminal] debug: msg undefined\n',
130+
'[agent-terminal] debug: msg Symbol(test)\n',
131131
'[agent-terminal] debug: msg 42\n',
132132
]);
133133
});

0 commit comments

Comments
 (0)