Logging still sucks.

This commit is contained in:
mmcwilliams 2019-03-09 13:17:32 -05:00
parent 15bb696b59
commit 00b5efa484
1 changed files with 6 additions and 8 deletions

View File

@ -774,13 +774,13 @@ log.transport = createLogger({
new (transports.Console)({ new (transports.Console)({
json : false, json : false,
format : combine( format : combine(
//label({ label: 'mcopy-app' }), label({ label: 'mcopy-app' }),
//timestamp(), timestamp(),
//format.colorize({ all: true }), //format.colorize({ all: true }),
//format.splat(), //format.splat(),
//format.json(), //format.json(),
//format.simple(), format.simple(),
log.formatter //log.formatter
) )
}), }),
new (transports.File)({ new (transports.File)({
@ -796,19 +796,17 @@ log.display = function (obj) {
} }
log.listen = function () { log.listen = function () {
ipcMain.on('log', (event, arg) => { ipcMain.on('log', (event, arg) => {
arg.source = 'renderer' log.transport.info(`[renderer] action=${arg.action} service=${arg.service} status=${arg.status}`)
log.transport.info(arg)
event.returnValue = true event.returnValue = true
}) })
} }
log.info = function (action, service, status, display) { log.info = function (action, service, status, display) {
var obj = { var obj = {
source: 'main',
action : action, action : action,
service : service, service : service,
status : status status : status
} }
log.transport.info(obj) log.transport.info(`[main] action=${action} service=${service} status=${status}`)
if (display) { if (display) {
log.display(obj) log.display(obj)
} }