@@ -56,16 +56,22 @@ export class LogWatcher {
5656 const consentToCollectLogs = vscode . workspace . getConfiguration ( "java" ) . get < boolean > ( "help.collectErrorLog" ) ;
5757 if ( errors ) {
5858 errors . forEach ( e => {
59- consentToCollectLogs ? sendInfo ( "" , {
60- name : "jdtls-error" ,
61- error : e . message ,
62- stack : e . stack ! ,
63- timestamp : e . timestamp ! . toString ( )
64- } ) : sendInfo ( "" , {
65- name : "jdtls-error" ,
66- error : redact ( e . message ) ,
67- timestamp : e . timestamp ! . toString ( )
68- } ) ;
59+ if ( consentToCollectLogs ) {
60+ sendInfo ( "" , {
61+ name : "jdtls-error" ,
62+ error : e . message ,
63+ stack : e . stack ! ,
64+ timestamp : e . timestamp ! . toString ( )
65+ } ) ;
66+ } else {
67+ const { message, tags} = redact ( e . message ) ;
68+ sendInfo ( "" , {
69+ name : "jdtls-error" ,
70+ error : message ,
71+ tags : tags . join ( "," ) ,
72+ timestamp : e . timestamp ! . toString ( )
73+ } )
74+ }
6975 } )
7076 }
7177 this . logProcessedTimestamp = Date . now ( ) ;
@@ -108,16 +114,23 @@ export class LogWatcher {
108114 const consentToCollectLogs = vscode . workspace . getConfiguration ( "java" ) . get < boolean > ( "help.collectErrorLog" ) ;
109115 if ( errors ) {
110116 errors . forEach ( e => {
111- consentToCollectLogs ? sendInfo ( "" , {
112- name : "jdtls-error-in-crashed-session" ,
113- error : e . message ,
114- stack : e . stack ! ,
115- timestamp : e . timestamp ! . toString ( )
116- } ) : sendInfo ( "" , {
117- name : "jdtls-error-in-crashed-session" ,
118- error : redact ( e . message ) ,
119- timestamp : e . timestamp ! . toString ( )
120- } ) ;
117+ if ( consentToCollectLogs ) {
118+ sendInfo ( "" , {
119+ name : "jdtls-error-in-crashed-session" ,
120+ error : e . message ,
121+ stack : e . stack ! ,
122+ timestamp : e . timestamp ! . toString ( )
123+ } )
124+ } else {
125+ const { message, tags } = redact ( e . message ) ;
126+ sendInfo ( "" , {
127+ name : "jdtls-error-in-crashed-session" ,
128+ error : message ,
129+ tags : tags . join ( "," ) ,
130+ timestamp : e . timestamp ! . toString ( )
131+ } )
132+ }
133+
121134 } )
122135 }
123136 }
0 commit comments