Skip to content

Commit

Permalink
Merge pull request #947 from DustinCampbell/improve-server-logging
Browse files Browse the repository at this point in the history
Improve OmniSharp server logging when _debugMode is true
  • Loading branch information
DustinCampbell authored Nov 15, 2016
2 parents 3e996e3 + 0bad7f6 commit a4ea8d3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/omnisharp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@ export class OmniSharpServer {
return Promise.reject<TResponse>('server has been stopped or not started');
}

console.log(`makeRequest: command=${command}`);

let startTime: number;
let request: Request;

Expand Down Expand Up @@ -523,6 +521,10 @@ export class OmniSharpServer {
return;
}

if (this._debugMode) {
this._logger.appendLine(`handleResponse: ${packet.Command} (${packet.Request_seq})`);
}

if (packet.Success) {
request.onSuccess(packet.Body);
}
Expand Down Expand Up @@ -555,7 +557,11 @@ export class OmniSharpServer {
};

if (this._debugMode) {
this._logger.appendLine(`Making request: ${request.command} (${id})`);
this._logger.append(`makeRequest: ${request.command} (${id})`);
if (request.data) {
this._logger.append(`, data=${JSON.stringify(request.data)}`);
}
this._logger.appendLine();
}

this._serverProcess.stdin.write(JSON.stringify(requestPacket) + '\n');
Expand Down

0 comments on commit a4ea8d3

Please sign in to comment.