import changes
This commit is contained in:
parent
0588d24882
commit
7e140d1ce8
1 changed files with 38 additions and 39 deletions
|
@ -1,7 +1,6 @@
|
|||
const { createLogger, format, transports, addColors } = require("winston");
|
||||
const { combine, timestamp, printf, colorize } = format;
|
||||
const { createLogger, format, transports, addColors } = require('winston');
|
||||
|
||||
const fmt = printf(({ level, message, timestamp }) => {
|
||||
const fmt = format.printf(({ level, message, timestamp }) => {
|
||||
return '[' + timestamp + '] ' + level + ' ' + message;
|
||||
});
|
||||
|
||||
|
@ -16,33 +15,33 @@ const customLevels = {
|
|||
},
|
||||
|
||||
colours: {
|
||||
debug: "black magentaBG",
|
||||
cmd: "black whiteBG",
|
||||
info: "black cyanBG",
|
||||
ready: "black greenBG",
|
||||
warn: "black yellowBG",
|
||||
error: "black redBG"
|
||||
debug: 'black magentaBG',
|
||||
cmd: 'black whiteBG',
|
||||
info: 'black cyanBG',
|
||||
ready: 'black greenBG',
|
||||
warn: 'black yellowBG',
|
||||
error: 'black redBG'
|
||||
}
|
||||
};
|
||||
|
||||
const logger = createLogger({
|
||||
levels: customLevels.levels,
|
||||
level: "error",
|
||||
format: combine(
|
||||
timestamp({
|
||||
format: "YYYY-MM-DD hh:mm:ss"
|
||||
level: 'error',
|
||||
format: format.combine(
|
||||
format.timestamp({
|
||||
format: 'YYYY-MM-DD hh:mm:ss'
|
||||
}),
|
||||
fmt
|
||||
),
|
||||
|
||||
transports: [
|
||||
new transports.Console({
|
||||
level: "error",
|
||||
format: combine(
|
||||
timestamp({
|
||||
format: "YYYY-MM-DD hh:mm:ss"
|
||||
level: 'error',
|
||||
format: format.combine(
|
||||
format.timestamp({
|
||||
format: 'YYYY-MM-DD hh:mm:ss'
|
||||
}),
|
||||
colorize(),
|
||||
format.colorize(),
|
||||
fmt
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue