@@ -9,28 +9,28 @@ export class ConsoleErrorLogger extends QuickAddLogger {
99 const error = this . getQuickAddError ( errorMsg , ErrorLevel . Error , stack , originalError ) ;
1010 this . addMessageToErrorLog ( error ) ;
1111
12- if ( originalError ) {
13- console . error ( this . formatOutputString ( error ) , originalError ) ;
14- } else {
15- console . error ( this . formatOutputString ( error ) ) ;
16- }
12+ // Always pass the original error or create a new one to leverage Dev Tools' stack trace UI
13+ const errorToLog = originalError || new Error ( errorMsg ) ;
14+
15+ // Just log the message as the first argument and the error object as the second
16+ console . error ( this . formatOutputString ( error ) , errorToLog ) ;
1717 }
1818
1919 public logWarning ( warningMsg : string , stack ?: string , originalError ?: Error ) {
2020 const warning = this . getQuickAddError ( warningMsg , ErrorLevel . Warning , stack , originalError ) ;
2121 this . addMessageToErrorLog ( warning ) ;
2222
23- if ( originalError ) {
24- console . warn ( this . formatOutputString ( warning ) , originalError ) ;
25- } else {
26- console . warn ( this . formatOutputString ( warning ) ) ;
27- }
23+ // Always pass the original error or create a new one to leverage Dev Tools' stack trace UI
24+ const errorToLog = originalError || new Error ( warningMsg ) ;
25+
26+ console . warn ( this . formatOutputString ( warning ) , errorToLog ) ;
2827 }
2928
3029 public logMessage ( logMsg : string , stack ?: string , originalError ?: Error ) {
3130 const log = this . getQuickAddError ( logMsg , ErrorLevel . Log , stack , originalError ) ;
3231 this . addMessageToErrorLog ( log ) ;
3332
33+ // For regular logs, we'll still show the error if available
3434 if ( originalError ) {
3535 console . log ( this . formatOutputString ( log ) , originalError ) ;
3636 } else {
0 commit comments