Merge pull request #303 from ZynerOrg/deepsource-transform-28a2b611
Format code with standardjs and prettier
This commit is contained in:
commit
64f5f1f5dd
1 changed files with 26 additions and 23 deletions
|
@ -4,27 +4,30 @@ import "winston-daily-rotate-file";
|
|||
const { combine, timestamp, printf, colorize, align, json } = winston.format;
|
||||
|
||||
module.exports = {
|
||||
// Logger initialized async-hronously
|
||||
logger: async () => {
|
||||
return winston.createLogger({
|
||||
level: process.env.LOG_LEVEL || "silly",
|
||||
transports: [
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: "logs/combined-%DATE%.log",
|
||||
datePattern: "YYYY-MM-DD",
|
||||
maxFiles: "14d",
|
||||
format: combine(timestamp(), json()),
|
||||
}),
|
||||
new winston.transports.Console({
|
||||
format: combine(
|
||||
colorize({ all: true }),
|
||||
timestamp({
|
||||
format: "YYYY-MM-DD HH:MM:ss",
|
||||
// Logger initialized async-hronously
|
||||
logger: async () => {
|
||||
return winston.createLogger({
|
||||
level: process.env.LOG_LEVEL || "silly",
|
||||
transports: [
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: "logs/combined-%DATE%.log",
|
||||
datePattern: "YYYY-MM-DD",
|
||||
maxFiles: "14d",
|
||||
format: combine(timestamp(), json()),
|
||||
}),
|
||||
align(),
|
||||
printf((info) => `[${info.timestamp}] ${info.level}: ${info.message}`)
|
||||
),
|
||||
}),
|
||||
],
|
||||
});
|
||||
}}
|
||||
new winston.transports.Console({
|
||||
format: combine(
|
||||
colorize({ all: true }),
|
||||
timestamp({
|
||||
format: "YYYY-MM-DD HH:MM:ss",
|
||||
}),
|
||||
align(),
|
||||
printf(
|
||||
(info) => `[${info.timestamp}] ${info.level}: ${info.message}`
|
||||
)
|
||||
),
|
||||
}),
|
||||
],
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue