10
10
import Debug from 'debug'
11
11
import { END_TAG } from './constants'
12
12
13
- const debug = Debug ( `cypress:stderr-filtering:LineDecoder:${ process . pid } ` )
13
+ const debugVerbose = Debug ( `cypress-verbose :stderr-filtering:LineDecoder:${ process . pid } ` )
14
14
15
15
export class LineDecoder {
16
16
private buffer : string = ''
@@ -23,7 +23,7 @@ export class LineDecoder {
23
23
* @param chunk The string chunk to add to the buffer
24
24
*/
25
25
public write ( chunk : string ) {
26
- debug ( 'writing chunk to line decoder' , { chunk } )
26
+ debugVerbose ( 'writing chunk to line decoder' , { chunk } )
27
27
this . buffer += chunk
28
28
}
29
29
@@ -37,16 +37,16 @@ export class LineDecoder {
37
37
* @yields Complete lines with newline characters preserved
38
38
*/
39
39
* [ Symbol . iterator ] ( ) : Generator < string > {
40
- debug ( 'iterating over lines in line decoder' )
40
+ debugVerbose ( 'iterating over lines in line decoder' )
41
41
42
42
let nextLine : string | undefined = undefined
43
43
44
44
do {
45
45
nextLine = this . nextLine ( )
46
46
47
47
if ( nextLine ) {
48
- debug ( 'yielding line:' , nextLine )
49
- debug ( 'buffer size:' , this . buffer . length )
48
+ debugVerbose ( 'yielding line:' , nextLine )
49
+ debugVerbose ( 'buffer size:' , this . buffer . length )
50
50
yield nextLine
51
51
}
52
52
} while ( nextLine )
@@ -79,7 +79,7 @@ export class LineDecoder {
79
79
const endsWithOverrideToken = newlineIndex < 0 ? this . buffer . endsWith ( this . overrideToken ) : false
80
80
81
81
if ( endsWithOverrideToken ) {
82
- debug ( 'ends with override token' )
82
+ debugVerbose ( 'ends with override token' )
83
83
const line = this . buffer
84
84
85
85
this . buffer = ''
@@ -88,7 +88,7 @@ export class LineDecoder {
88
88
}
89
89
90
90
if ( newlineIndex >= 0 ) {
91
- debug ( 'contains a newline' )
91
+ debugVerbose ( 'contains a newline' )
92
92
const line = this . buffer . slice ( 0 , newlineIndex + length )
93
93
94
94
this . buffer = this . buffer . slice ( newlineIndex + length )
0 commit comments