mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
beginning of large-scale redesign
This commit is contained in:
20
server/modules/Logger.js
Normal file
20
server/modules/Logger.js
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user