mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
27 lines
774 B
JavaScript
27 lines
774 B
JavaScript
module.exports = function (debugMode = false) {
|
|
return {
|
|
log (message = '') {
|
|
const now = new Date();
|
|
console.log('LOG ', now.toGMTString(), ': ', message);
|
|
},
|
|
|
|
debug (message = '') {
|
|
if (!debugMode) return;
|
|
const now = new Date();
|
|
console.debug('DEBUG ', now.toGMTString(), ': ', message);
|
|
},
|
|
|
|
error (message = '') {
|
|
if (!debugMode) return;
|
|
const now = new Date();
|
|
console.error('ERROR ', now.toGMTString(), ': ', message);
|
|
},
|
|
|
|
warn (message = '') {
|
|
if (!debugMode) return;
|
|
const now = new Date();
|
|
console.error('WARNING ', now.toGMTString(), ': ', message);
|
|
}
|
|
};
|
|
};
|