Simplify logs. Still prints timestamp as json.
This commit is contained in:
parent
029dd628b6
commit
a4682ed9d3
13
app/main.js
13
app/main.js
|
@ -8,7 +8,7 @@ const { Menu, MenuItem, ipcMain, BrowserWindow, app } = electron
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const os = require('os')
|
const os = require('os')
|
||||||
const { createLogger, format, transports } = require('winston')
|
const { createLogger, format, transports } = require('winston')
|
||||||
const { combine, timestamp, label, printf, prettyPrint } = format
|
const { combine, timestamp, label, printf, colorize, prettyPrint, simple } = format
|
||||||
const moment = require('moment')
|
const moment = require('moment')
|
||||||
const uuid = require('uuid')
|
const uuid = require('uuid')
|
||||||
const events = require('events')
|
const events = require('events')
|
||||||
|
@ -772,19 +772,16 @@ log.formatter = (options) => {
|
||||||
log.transport = createLogger({
|
log.transport = createLogger({
|
||||||
transports: [
|
transports: [
|
||||||
new (transports.Console)({
|
new (transports.Console)({
|
||||||
|
level: 'info',
|
||||||
json : false,
|
json : false,
|
||||||
format : combine(
|
format : combine(
|
||||||
label({ label: 'mcopy-app' }),
|
|
||||||
timestamp(),
|
timestamp(),
|
||||||
//format.colorize({ all: true }),
|
colorize(),
|
||||||
//format.splat(),
|
simple()
|
||||||
//format.json(),
|
|
||||||
format.simple(),
|
|
||||||
//log.formatter
|
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
new (transports.File)({
|
new (transports.File)({
|
||||||
filename: log.file()
|
filename: log.file()
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue