File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -281,16 +281,31 @@ export class Tracer {
281281 }
282282
283283 let log : string = ''
284+ let messageCounter : number = 0
285+ // Avoid filling the user memory with log messages
286+ let maxLocalMessages : number = 1000
284287 return {
285288 name : 'websocket' ,
286289
287290 append : ( value : string ) => {
291+ messageCounter ++
292+ if ( messageCounter > maxLocalMessages ) {
293+ messageCounter = 0
294+ localOutputChannel . clear ( )
295+ }
296+
288297 localOutputChannel . append ( value )
289298 if ( this . tracingConsent . get ( ) === 'Deny' ) return
290299 log += value
291300 } ,
292301
293302 appendLine : ( value : string ) => {
303+ messageCounter ++
304+ if ( messageCounter > maxLocalMessages ) {
305+ messageCounter = 0
306+ localOutputChannel . clear ( )
307+ }
308+
294309 localOutputChannel . appendLine ( value )
295310 if ( this . tracingConsent . get ( ) === 'Deny' ) {
296311 log = ''
You can’t perform that action at this time.
0 commit comments