mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-30 08:49:16 +02:00
refactor
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
const { verboseMode } = require('./userconfig');
|
||||
|
||||
const MESSAGE_PREFIX = {
|
||||
INFO: "\x1b[32m[INFO]\x1b[0m",
|
||||
DEBUG: "\x1b[36m[DEBUG]\x1b[0m",
|
||||
};
|
||||
|
||||
const logInfo = (...messages) => console.log(MESSAGE_PREFIX.INFO, ...messages);
|
||||
const logDebug = (...messages) => {
|
||||
if (verboseMode) {
|
||||
console.log(MESSAGE_PREFIX.DEBUG, ...messages);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
logInfo, logDebug
|
||||
}
|
||||
Reference in New Issue
Block a user