Redact all private information from logs
This commit is contained in:
parent
0e2f8a8a06
commit
0c317c5498
1 changed files with 8 additions and 3 deletions
|
@ -7,7 +7,7 @@ const bunyan = require('bunyan');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
|
||||||
const debuglogs = require('./modules/debuglogs');
|
const debuglogs = require('./modules/debuglogs');
|
||||||
|
const Errors = require('./modules/types/errors');
|
||||||
|
|
||||||
const ipc = electron.ipcRenderer;
|
const ipc = electron.ipcRenderer;
|
||||||
const PHONE_REGEX = /\+\d{7,12}(\d{3})/g;
|
const PHONE_REGEX = /\+\d{7,12}(\d{3})/g;
|
||||||
|
@ -60,7 +60,8 @@ function log(...args) {
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
const toSend = redactGroup(redactPhone(str.join(' ')));
|
|
||||||
|
const toSend = redactAll(str.join(' '));
|
||||||
ipc.send('log-info', toSend);
|
ipc.send('log-info', toSend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +96,11 @@ function formatLine(entry) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function format(entries) {
|
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() {
|
function fetch() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue