@@ -106,7 +106,7 @@ class ResReqNetSocket extends EventEmitter {
106
106
that . conn . on ( 'close' , function ( ) {
107
107
if ( ! that . connected )
108
108
{
109
- reject ( "Cannot not connect. Check the application is running on the device" ) ;
109
+ reject ( "Can't connect. Check the application is running on the device" ) ;
110
110
that . emit ( 'close' , that . lastError || 'Debugged process exited.' ) ;
111
111
return ;
112
112
}
@@ -136,16 +136,14 @@ class ResReqNetSocket extends EventEmitter {
136
136
this . debugBuffer = b . toString ( 'utf8' , this . msg . contentLength , b . length ) ;
137
137
if ( this . msg . body . length > 0 ) {
138
138
obj = JSON . parse ( this . msg . body ) ;
139
+ Logger . log ( 'From target(' + ( obj . type ? obj . type : '' ) + '): ' + this . msg . body ) ;
139
140
if ( typeof obj . running === 'boolean' ) {
140
141
this . isRunning = obj . running ;
141
142
}
142
143
if ( obj . type === 'response' && obj . request_seq > 0 ) {
143
- console . log ( 'response: ' + this . msg . body ) ;
144
144
this . callbacks . processResponse ( obj . request_seq , [ obj ] ) ;
145
145
}
146
146
else if ( obj . type === 'event' ) {
147
- console . log ( 'event: ' + obj . event + " obj: " + JSON . stringify ( obj ) ) ;
148
-
149
147
if ( obj . event === "afterCompile" ) {
150
148
if ( ! that . connected && connectedCallback ) {
151
149
connectedCallback ( ) ;
@@ -154,9 +152,6 @@ class ResReqNetSocket extends EventEmitter {
154
152
155
153
this . emit ( obj . event , obj ) ;
156
154
}
157
- else {
158
- console . log ( 'unknown: ' + this . msg . body ) ;
159
- }
160
155
}
161
156
this . msg = false ;
162
157
this . parse ( connectedCallback ) ;
@@ -186,6 +181,7 @@ class ResReqNetSocket extends EventEmitter {
186
181
187
182
public send ( data ) {
188
183
if ( this . connected ) {
184
+ Logger . log ( 'To target: ' + data ) ;
189
185
this . conn . write ( 'Content-Length: ' + data . length + '\r\n\r\n' + data ) ;
190
186
}
191
187
}
0 commit comments