@josecarlosrz/logger
Advanced tools
Comparing version 1.0.22 to 1.0.23
79
index.js
@@ -11,5 +11,7 @@ const nodeConsole = require('console'); | ||
const LoggerChecker = { | ||
class LoggerChecker | ||
{ | ||
isLoggerDisabled: function() { | ||
static isLoggerDisabled() | ||
{ | ||
@@ -21,5 +23,6 @@ return ( | ||
}, | ||
} | ||
isSleepDisabled: function() { | ||
static isSleepDisabled() | ||
{ | ||
@@ -31,5 +34,6 @@ return ( | ||
}, | ||
} | ||
isDev: function() { | ||
static isDev() | ||
{ | ||
@@ -41,9 +45,11 @@ return ( | ||
}, | ||
} | ||
}; | ||
} | ||
const TmpLogger = { | ||
class TmpLogger | ||
{ | ||
logger: function(message, ...args) { | ||
static log(message, ...args) | ||
{ | ||
@@ -84,5 +90,6 @@ const stack = stackTrace.get(); | ||
}, | ||
} | ||
sleep: function(seconds) { | ||
static sleep(seconds) | ||
{ | ||
@@ -93,16 +100,19 @@ return new Promise((resolve, reject) => { | ||
}, | ||
} | ||
}; | ||
} | ||
const Logger = { | ||
class Logger | ||
{ | ||
logger: function(message, ...args) { | ||
static log(message, ...args) | ||
{ | ||
if (!Logger.isLoggerDisabled()) | ||
TmpLogger.logger(message, ...args); | ||
TmpLogger.log(message, ...args); | ||
}, | ||
} | ||
sleep: async function(seconds) { | ||
static async sleep(seconds) | ||
{ | ||
@@ -112,12 +122,14 @@ if (!Logger.isSleepDisabled()) | ||
}, | ||
} | ||
devLogger: function(message, ...args) { | ||
static devLog(message, ...args) | ||
{ | ||
if (!Logger.isLoggerDisabled() && Logger.isDev()) | ||
TmpLogger.logger(message, ...args); | ||
TmpLogger.log(message, ...args); | ||
}, | ||
} | ||
devSleep: async function(seconds) { | ||
static async devSleep(seconds) | ||
{ | ||
@@ -127,18 +139,21 @@ if (!Logger.isSleepDisabled() && Logger.isDev()) | ||
}, | ||
} | ||
isLoggerDisabled: function() { | ||
static isLoggerDisabled() | ||
{ | ||
return LoggerChecker.isLoggerDisabled(); | ||
}, | ||
} | ||
isSleepDisabled: function() { | ||
static isSleepDisabled() | ||
{ | ||
return LoggerChecker.isSleepDisabled(); | ||
}, | ||
} | ||
isDev: function() { | ||
static isDev() | ||
{ | ||
return LoggerChecker.isDev(); | ||
}, | ||
} | ||
}; | ||
} | ||
module.exports = Logger; |
{ | ||
"name": "@josecarlosrz/logger", | ||
"version": "1.0.22", | ||
"version": "1.0.23", | ||
"description": "Function to log each component of our application", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3737
3
100
8