Skip to content

Instantly share code, notes, and snippets.

@endorama
Last active August 29, 2015 14:06
Show Gist options
  • Save endorama/ee0624d2798585590311 to your computer and use it in GitHub Desktop.
Save endorama/ee0624d2798585590311 to your computer and use it in GitHub Desktop.
FilterLog example
{
[...]
addWithData: function(msg, data) {
var copy = angular.copy(data);
this.maskReserved(copy);
$log.debug(msg + ' :: ' + copy, type);
},
maskReserved: function(obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === "object") {
this.maskReserved(obj[key]);
}
else {
if (key === 'password') {
obj[key] = '**********';
}
}
}
}
},
[...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment