Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ba-js-logger

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ba-js-logger - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

37

lib/logger.js

@@ -58,3 +58,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; }; }();

key: 'postRequest',
value: function postRequest(message, level, logger) {
value: function postRequest(message) {
var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var level = arguments[2];
var logger = arguments[3];
var endpoint = this.url + '/' + level;

@@ -69,9 +73,14 @@ if (logger) {

params.append('message', '' + message + stamp);
return axios.post(endpoint, params);
return axios({
url: endpoint,
method: 'post',
headers: headers,
data: params
});
}
}, {
key: 'send',
value: function send(message, level, logger) {
value: function send(message, headers, level, logger) {
if (Logger.LEVEL(level) >= this.lvl) {
return this.postRequest(message, level, logger);
return this.postRequest(message, headers, level, logger);
}

@@ -82,24 +91,24 @@ return Promise.resolve();

key: 'debug',
value: function debug(message, logger) {
return this.send(message, Logger.LEVEL_DEBUG, logger);
value: function debug(message, headers, logger) {
return this.send(message, headers, Logger.LEVEL_DEBUG, logger);
}
}, {
key: 'info',
value: function info(message, logger) {
return this.send(message, Logger.LEVEL_INFO, logger);
value: function info(message, headers, logger) {
return this.send(message, headers, Logger.LEVEL_INFO, logger);
}
}, {
key: 'warn',
value: function warn(message, logger) {
return this.send(message, Logger.LEVEL_WARN, logger);
value: function warn(message, headers, logger) {
return this.send(message, headers, Logger.LEVEL_WARN, logger);
}
}, {
key: 'error',
value: function error(message, logger) {
return this.send(message, Logger.LEVEL_ERROR, logger);
value: function error(message, headers, logger) {
return this.send(message, headers, Logger.LEVEL_ERROR, logger);
}
}, {
key: 'fatal',
value: function fatal(message, logger) {
return this.send(message, Logger.LEVEL_FATAL, logger);
value: function fatal(message, headers, logger) {
return this.send(message, headers, Logger.LEVEL_FATAL, logger);
}

@@ -106,0 +115,0 @@ }]);

@@ -17,3 +17,3 @@ {

"name": "ba-js-logger",
"version": "1.2.2",
"version": "1.3.0",
"files": [

@@ -20,0 +20,0 @@ "lib/"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc