Skip to content

Commit

Permalink
Fix including error content in log
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Jul 17, 2017
1 parent 5dd5b86 commit 97a7bd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function logAtLevel(color, level, ...args) {
}

const redactUrls = s => {
if(s && typeof s !== 'string') s = JSON.stringify(s);
if(s instanceof Error) s = s.toString();
else if(s && typeof s !== 'string') s = JSON.stringify(s);
return s && s.replace(/(http[s]?:\/\/[^:]*):[^@]*@/g, '$1:****@');
};

0 comments on commit 97a7bd9

Please sign in to comment.