Redact all private information from logs

This commit is contained in:
Daniel Gasienica 2018-03-06 12:46:38 -05:00
parent 0e2f8a8a06
commit 0c317c5498

View file

@ -7,7 +7,7 @@ const bunyan = require('bunyan');
const _ = require('lodash');
const debuglogs = require('./modules/debuglogs');
const Errors = require('./modules/types/errors');
const ipc = electron.ipcRenderer;
const PHONE_REGEX = /\+\d{7,12}(\d{3})/g;
@ -60,7 +60,8 @@ function log(...args) {
return item;
});
const toSend = redactGroup(redactPhone(str.join(' ')));
const toSend = redactAll(str.join(' '));
ipc.send('log-info', toSend);
}
@ -95,7 +96,11 @@ function formatLine(entry) {
}
function format(entries) {
return redactGroup(redactPhone(entries.map(formatLine).join('\n')));
return redactAll(entries.map(formatLine).join('\n')));
}
function redactAll(string) {
return Errors.redactSensitivePaths(redactGroup(redactPhone(string)));
}
function fetch() {