Skip to content
Extraits de code Groupes Projets
Vérifiée Valider ab62341a rédigé par Kubat's avatar Kubat
Parcourir les fichiers

MISC: Update logger

parent c0af840b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
2 requêtes de fusion!3Dev kubat,!1Create basic lib
......@@ -12,28 +12,38 @@
const winston = require('winston');
const __loggerCustomLevels = {
levels: {
debug: 3,
info: 2,
warn: 1,
warning: 1,
error: 0
},
colors: {
debug: 'blue',
info: 'green',
warn: 'yellow',
warning: 'yellow',
error: 'red'
}
label: "default",
levels: {
debug: 3,
info: 2,
warn: 1,
warning: 1,
error: 0
},
colors: {
debug: 'blue',
info: 'green',
warn: 'yellow',
warning: 'yellow',
error: 'red'
}
};
const __myFormat = winston.format.printf(({ level, message, label, timestamp }) => {
return `[${timestamp}] ${level}\t ${message}`;
});
module.exports = global.logger = module.exports = winston.createLogger({
transports: [new winston.transports.Console()],
level: "debug",
levels: __loggerCustomLevels.levels,
format: winston.format.combine(
winston.format.colorize({ all: true }),
winston.format.simple()
)
transports: [new winston.transports.Console()],
level: "debug",
json: false,
handleExceptions: true,
levels: __loggerCustomLevels.levels,
format: winston.format.combine(
winston.format.timestamp({format: 'YYYY-MM-DD HH:mm:ss'}),
winston.format.label(),
winston.format.colorize({ all: true }),
winston.format.simple(),
__myFormat
)
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter