Skip to content

Commit fa55f39

Browse files
author
Lucas Thomas
committed
SF-3514 Invalid JSON is coming in to StackifyAPI from Winston. Removed code that removed 'Msgs' property.
1 parent 4e966ae commit fa55f39

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lib/debug.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var fs = require('fs'),
1212
stream = fs.createWriteStream(log_path, {flags: 'a'});
1313
stream.write(makeMsg('Debugging started'));
1414
stream.on('error', function (err) {
15-
console.error('Error occured during writing to the log file ', util.inspect(err));
15+
console.error('Error occurred during writing to the log file ', util.inspect(err));
1616
});
1717
};
1818

@@ -31,22 +31,16 @@ module.exports = {
3131
}
3232
},
3333

34-
writeResponse: function (response, close) {
34+
writeResponse: function (response) {
3535
var body = response ? response.body : null,
3636
msgBody = (body && typeof body === 'object') ? JSON.stringify(response.body, null, 4) : body,
3737
msg = response ? ('url: ' + response.request.uri.href + ':' + response.request.uri.port + ', method: '
3838
+ response.req.method + ', status: ' + response.statusCode + '\nresponse: ' + msgBody) : 'no data available';
39-
if (close) {
40-
this.close('Response received\n' + msg);
41-
} else {
42-
this.write('Response received\n' + msg);
43-
}
39+
40+
this.write('Response received\n' + msg);
4441
},
4542

4643
writeRequest: function (request, close) {
47-
if (request.body.Msgs) {
48-
request.body.Msgs = request.body.Msgs.length + ' messages';
49-
}
5044
if (close) {
5145
this.close('Request sent\n' + JSON.stringify(request, null, 4));
5246
} else {

0 commit comments

Comments
 (0)