File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,8 +55,12 @@ export class ConsoleTransport implements Transport {
5555 ? `<${ this . options . noColor ? entry . category : pc . bold ( entry . category ) } > `
5656 : ""
5757
58- // Format message parts
59- const formattedMessage = this . formatMessageParts ( entry . messageParts || [ entry . message ] )
58+ // Format message parts - fall back to message if messageParts is empty
59+ let messageParts = entry . messageParts || [ ] ;
60+ if ( messageParts . length === 0 && entry . message ) {
61+ messageParts = [ entry . message ] ;
62+ }
63+ const formattedMessage = this . formatMessageParts ( messageParts )
6064
6165 // Combine all parts
6266 const fullMessage = `${ timestamp } ${ levelStr } ${ category } ${ formattedMessage } `
@@ -98,6 +102,11 @@ export class ConsoleTransport implements Transport {
98102 }
99103
100104 if ( typeof part === "object" ) {
105+ // Always use JSON.stringify for arrays
106+ if ( Array . isArray ( part ) ) {
107+ return JSON . stringify ( part )
108+ }
109+
101110 // Check if object has a non-default toString method
102111 if ( part . toString && part . toString !== Object . prototype . toString ) {
103112 return part . toString ( )
You can’t perform that action at this time.
0 commit comments