ba-js-logger
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -9,2 +9,7 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
_createClass(Logger, null, [{ | ||
key: 'LEVEL', | ||
value: function LEVEL(level) { | ||
return ['d', 'i', 'w', 'e', 'f'].indexOf(level); | ||
} | ||
}, { | ||
key: 'LEVEL_DEBUG', | ||
@@ -36,3 +41,3 @@ get: function get() { | ||
function Logger(url, context) { | ||
function Logger(url, context, level) { | ||
_classCallCheck(this, Logger); | ||
@@ -42,2 +47,3 @@ | ||
this.context = context; | ||
this.level = Logger.LEVEL(level || Logger.LEVEL_INFO); | ||
} | ||
@@ -65,3 +71,6 @@ | ||
value: function send(message, level, logger) { | ||
return this.postRequest(message, level, logger); | ||
if (Logger.LEVEL(level) >= this.level) { | ||
return this.postRequest(message, level, logger); | ||
} | ||
return undefined; | ||
} | ||
@@ -68,0 +77,0 @@ }, { |
@@ -17,3 +17,3 @@ { | ||
"name": "ba-js-logger", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"files": [ | ||
@@ -26,2 +26,3 @@ "lib/" | ||
"devDependencies": { | ||
"axios": "^0.17.1", | ||
"babel-cli": "^6.26.0", | ||
@@ -28,0 +29,0 @@ "babel-eslint": "^7.2.3", |
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
4477
95
21