feat: mise à jour du code

This commit is contained in:
UltraLionFr
2025-08-26 01:21:58 +02:00
parent 944845cd11
commit d3d3642ec3
29 changed files with 487 additions and 320 deletions
+10 -10
View File
@@ -1,27 +1,27 @@
const chalk = require("chalk");
const chalk = require('chalk');
function timestamp() {
return chalk.gray(`[${new Date().toLocaleTimeString("fr-FR")}]`);
return chalk.gray(`[${new Date().toLocaleTimeString('fr-FR')}]`);
}
const logger = {
info: (msg) => {
console.log(`${timestamp()} ${chalk.blue("[INFO]")} ${msg}`);
console.log(`${timestamp()} ${chalk.blue('[INFO]')} ${msg}`);
},
success: (msg) => {
console.log(`${timestamp()} ${chalk.green("[SUCCESS]")} ${msg}`);
console.log(`${timestamp()} ${chalk.green('[SUCCESS]')} ${msg}`);
},
warn: (msg) => {
console.warn(`${timestamp()} ${chalk.yellow("[WARN]")} ${msg}`);
console.warn(`${timestamp()} ${chalk.yellow('[WARN]')} ${msg}`);
},
error: (msg) => {
console.error(`${timestamp()} ${chalk.red("[ERROR]")} ${msg}`);
console.error(`${timestamp()} ${chalk.red('[ERROR]')} ${msg}`);
},
debug: (msg) => {
if (process.env.DEBUG === "true") {
console.log(`${timestamp()} ${chalk.magenta("[DEBUG]")} ${msg}`);
if (process.env.DEBUG === 'true') {
console.log(`${timestamp()} ${chalk.magenta('[DEBUG]')} ${msg}`);
}
}
},
};
module.exports = logger;
module.exports = logger;