File tree 1 file changed +15
-0
lines changed 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -281,16 +281,31 @@ export class Tracer {
281
281
}
282
282
283
283
let log : string = ''
284
+ let messageCounter : number = 0
285
+ // Avoid filling the user memory with log messages
286
+ let maxLocalMessages : number = 1000
284
287
return {
285
288
name : 'websocket' ,
286
289
287
290
append : ( value : string ) => {
291
+ messageCounter ++
292
+ if ( messageCounter > maxLocalMessages ) {
293
+ messageCounter = 0
294
+ localOutputChannel . clear ( )
295
+ }
296
+
288
297
localOutputChannel . append ( value )
289
298
if ( this . tracingConsent . get ( ) === 'Deny' ) return
290
299
log += value
291
300
} ,
292
301
293
302
appendLine : ( value : string ) => {
303
+ messageCounter ++
304
+ if ( messageCounter > maxLocalMessages ) {
305
+ messageCounter = 0
306
+ localOutputChannel . clear ( )
307
+ }
308
+
294
309
localOutputChannel . appendLine ( value )
295
310
if ( this . tracingConsent . get ( ) === 'Deny' ) {
296
311
log = ''
You can’t perform that action at this time.
0 commit comments