File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
99### Added
1010
1111- Option to start PHP built-in web server without router script.
12+ - Extended logging with DBGp packets.
1213
1314### Changed
1415
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ export class DbgpConnection extends EventEmitter {
8383 } ,
8484 } ,
8585 } )
86+ this . emit ( 'log' , `-> ${ xml . replace ( / [ \0 \n ] / g, '' ) } ` )
8687 const document = parser . parseFromString ( xml , 'application/xml' )
8788 this . emit ( 'message' , document )
8889 // reset buffer
@@ -107,6 +108,7 @@ export class DbgpConnection extends EventEmitter {
107108 public write ( command : Buffer ) : Promise < void > {
108109 return new Promise < void > ( ( resolve , reject ) => {
109110 if ( this . _socket . writable ) {
111+ this . emit ( 'log' , `<- ${ command . toString ( ) . replace ( / [ \0 \n ] / g, '' ) } ` )
110112 this . _socket . write ( command , ( ) => {
111113 resolve ( )
112114 } )
Original file line number Diff line number Diff line change @@ -295,6 +295,12 @@ class PhpDebugSession extends vscode.DebugSession {
295295 } )
296296 connection . on ( 'error' , disposeConnection )
297297 connection . on ( 'close' , disposeConnection )
298+ connection . on ( 'log' , ( text : string ) => {
299+ if ( this . _args && this . _args . log ) {
300+ const log = `xd(${ connection . id } ) ${ text } \n`
301+ this . sendEvent ( new vscode . OutputEvent ( log ) , true )
302+ }
303+ } )
298304 await connection . waitForInitPacket ( )
299305
300306 // support for breakpoints
You can’t perform that action at this time.
0 commit comments