@@ -12,19 +12,19 @@ if (process.argv[2] === 'child') {
1212process . on ( 'message' , function ( m , socket ) {
1313if ( ! socket ) return ;
1414
15- console . error ( '[%d ] got socket' , id , m ) ;
15+ console . error ( `[ ${ id } ] got socket${ m } ` ) ;
1616
1717// will call .end('end') or .write('write');
1818socket [ m ] ( m ) ;
1919
2020socket . resume ( ) ;
2121
2222socket . on ( 'data' , function ( ) {
23- console . error ( '[%d ] socket.data' , id , m ) ;
23+ console . error ( `[ ${ id } ] socket.data${ m } ` ) ;
2424} ) ;
2525
2626socket . on ( 'end' , function ( ) {
27- console . error ( '[%d ] socket.end' , id , m ) ;
27+ console . error ( `[ ${ id } ] socket.end${ m } ` ) ;
2828} ) ;
2929
3030// store the unfinished socket
@@ -33,27 +33,27 @@ if (process.argv[2] === 'child') {
3333}
3434
3535socket . on ( 'close' , function ( had_error ) {
36- console . error ( '[%d ] socket.close' , id , had_error , m ) ;
36+ console . error ( `[ ${ id } ] socket.close${ had_error } ${ m } ` ) ;
3737} ) ;
3838
3939socket . on ( 'finish' , function ( ) {
40- console . error ( '[%d ] socket finished' , id , m ) ;
40+ console . error ( `[ ${ id } ] socket finished${ m } ` ) ;
4141} ) ;
4242} ) ;
4343
4444process . on ( 'message' , function ( m ) {
4545if ( m !== 'close' ) return ;
46- console . error ( '[%d ] got close message' , id ) ;
46+ console . error ( `[ ${ id } ] got close message` ) ;
4747needEnd . forEach ( function ( endMe , i ) {
48- console . error ( '[%d ] ending %d/%d' , id , i , needEnd . length ) ;
48+ console . error ( `[ ${ id } ] ending ${ i } / ${ needEnd . length } ` ) ;
4949endMe . end ( 'end' ) ;
5050} ) ;
5151} ) ;
5252
5353process . on ( 'disconnect' , function ( ) {
54- console . error ( '[%d ] process disconnect, ending' , id ) ;
54+ console . error ( `[ ${ id } ] process disconnect, ending` ) ;
5555needEnd . forEach ( function ( endMe , i ) {
56- console . error ( '[%d ] ending %d/%d' , id , i , needEnd . length ) ;
56+ console . error ( `[ ${ id } ] ending ${ i } / ${ needEnd . length } ` ) ;
5757endMe . end ( 'end' ) ;
5858} ) ;
5959} ) ;
@@ -86,7 +86,7 @@ if (process.argv[2] === 'child') {
8686connected += 1 ;
8787
8888socket . once ( 'close' , function ( ) {
89- console . log ( ' [m] socket closed, total %d' , ++ closed ) ;
89+ console . log ( ` [m] socket closed, total ${ ++ closed } ` ) ;
9090} ) ;
9191
9292if ( connected === count ) {
0 commit comments