Skip to content

Commit

Permalink
Update myLogger.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NebzHB authored May 25, 2024
1 parent 6c2476a commit 7066a6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/myLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
var debug = {};
debug.DEBUG = 100;
debug.INFO = 200;
debug.WARN = 300;
debug.WARNING = 300;
debug.ERROR = 400;
debug.NO = 1000;

Expand All @@ -41,7 +41,7 @@ var loggerCache = {};
function myLogger(debugLevel,logger,creationLogPath) {
this.logger = logger;
this.debugLevel= debugLevel;
this.allowedLevel = ['debug','info','warn','error','conf'];
this.allowedLevel = ['debug','info','warning','error','conf'];
this.creationLogPath = creationLogPath;
this.creationPassed = false;
fs.writeFileSync(this.creationLogPath+startLog, '['+(new Date().toISOString())+"] ---Début du log de création---\n");
Expand Down Expand Up @@ -69,7 +69,7 @@ function myLogger(debugLevel,logger,creationLogPath) {
if(this.debugLevel == debug.NO) {msg=null;return;}
if(this.debugLevel > debug.DEBUG && level == "debug") {msg=null;return;}
if(this.debugLevel > debug.INFO && level == "info") {msg=null;return;}
if(this.debugLevel > debug.WARN && level == "warn") {msg=null;return;}
if(this.debugLevel > debug.WARNING && level == "warning") {msg=null;return;}
if(this.debugLevel > debug.ERROR && level == "error") {msg=null;return;}

this.logger(msg);
Expand Down

0 comments on commit 7066a6d

Please sign in to comment.