jshint: Turn on ES6 mode, fix a few issues in new logging file

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-09-25 15:32:31 -07:00
parent 6b11f67dc6
commit ba2df1f95b
No known key found for this signature in database
GPG key ID: A4931C09644C654B
2 changed files with 6 additions and 7 deletions

View file

@ -29,6 +29,7 @@
"debug" : false,
"eqnull" : false,
"es5" : false,
"esversion" : 6,
"esnext" : false,
"moz" : false,
"evil" : false,

View file

@ -1,5 +1,3 @@
'use strict';
const electron = require('electron');
const bunyan = require('bunyan');
const _ = require('lodash');
@ -35,13 +33,13 @@ function log() {
console._log.apply(console, consoleArgs);
const str = args.join(' ').replace(PHONE_REGEX, "+[REDACTED]$1");
ipc.send('log-info', str)
ipc.send('log-info', str);
}
if (window.console) {
console._log = console.log;
console.log = log;
};
}
// The mechanics of preparing a log for publish
@ -69,7 +67,7 @@ function format(entries) {
function fetch() {
return getHeader() + '\n' + format(ipc.sendSync('fetch-log'));
};
}
function publish(log) {
log = log || fetch();
@ -90,7 +88,7 @@ function publish(log) {
})
.fail(resolve);
});
};
}
// A modern logging interface for the browser
@ -129,7 +127,7 @@ window.log = {
trace: _.partial(logAtLevel, 'trace'),
fetch,
publish,
}
};
window.onerror = function(message, script, line, col, error) {
log.error(error.stack);