Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
formatters: buffer.toString for debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron McCall committed Apr 18, 2016
1 parent c6e26c2 commit ec81e36
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/formatters/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (err, data) {

if (err) {
if (data) {
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(data) + '\n';
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n';
}

return returnString + Chalk.yellow('(+) ') + err;
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = function (err, data) {

if (err) {
return 'Debug output: ' + JSON.stringify(data) + '\n' + JSON.stringify(err);
return 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n' + JSON.stringify(err);
}

return JSON.stringify(data, null, 2);
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (err, data) {

if (err) {
if (data) {
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(data) + '\n';
returnString += Chalk.red('(+) ') + 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n';
}

return returnString + Chalk.yellow('(+) ') + err;
Expand Down

0 comments on commit ec81e36

Please sign in to comment.