backendless 7.1.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Welcome to Backendless!
2
2
 
3
+ [![Check](https://github.com/Backendless/JS-SDK/actions/workflows/main.yml/badge.svg)](https://github.com/Backendless/JS-SDK/actions/workflows/main.yml)
3
4
  [![Build Status](https://travis-ci.com/Backendless/JS-SDK.svg?branch=master)](https://travis-ci.com/Backendless/JS-SDK)
4
5
  [![npm version](https://img.shields.io/npm/v/backendless.svg?style=flat)](https://www.npmjs.com/package/backendless)
5
6
  [![dependencies Status](https://david-dm.org/backendless/JS-SDK/status.svg)](https://david-dm.org/backendless/JS-SDK)
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * ********************************************************************************************************************
3
- * Backendless SDK for JavaScript. Version: 7.1.0
3
+ * Backendless SDK for JavaScript. Version: 7.2.0
4
4
  *
5
5
  * Copyright 2012-2023 BACKENDLESS.COM. All Rights Reserved.
6
6
  *
@@ -6437,7 +6437,7 @@ var Backendless = /*#__PURE__*/function () {
6437
6437
  app.__removeService('LocalCache');
6438
6438
  var loggingConfig = (0, _extends2["default"])({
6439
6439
  loadLevels: true,
6440
- defaultLevel: 'all',
6440
+ globalLevel: 'all',
6441
6441
  levels: {}
6442
6442
  }, config.logging);
6443
6443
  if (app.__hasService('Logging')) {
@@ -7056,8 +7056,8 @@ var Logging = /*#__PURE__*/function () {
7056
7056
  if (config.levels) {
7057
7057
  this.levels = config.levels;
7058
7058
  }
7059
- if (config.defaultLevel) {
7060
- this.defaultLevel = config.defaultLevel;
7059
+ if (config.globalLevel) {
7060
+ this.globalLevel = config.globalLevel;
7061
7061
  }
7062
7062
  if (config.loadLevels) {
7063
7063
  this.loadLoggingLevels();
@@ -7067,7 +7067,7 @@ var Logging = /*#__PURE__*/function () {
7067
7067
  key: "reset",
7068
7068
  value: function reset() {
7069
7069
  this.levels = {};
7070
- this.defaultLevel = 'all';
7070
+ this.globalLevel = 'all';
7071
7071
  this.loggers = {};
7072
7072
  this.messages = [];
7073
7073
  this.numOfMessages = 10;
@@ -7080,11 +7080,16 @@ var Logging = /*#__PURE__*/function () {
7080
7080
  var _this = this;
7081
7081
  this.app.request.get({
7082
7082
  url: this.app.urls.loggingLevels()
7083
- }).then(function (loggers) {
7084
- loggers.forEach(function (logger) {
7085
- _this.levels[logger.name] = logger.level;
7083
+ }).then(function (loggersList) {
7084
+ var loggers = {};
7085
+ loggersList.forEach(function (logger) {
7086
+ loggers[logger.name] = logger.level;
7087
+ });
7088
+ var globalLevel = loggers[GLOBAL_LOGGER_NAME];
7089
+ _this.setConfig({
7090
+ loggers: loggers,
7091
+ globalLevel: globalLevel
7086
7092
  });
7087
- _this.defaultLevel = _this.levels[GLOBAL_LOGGER_NAME] || _this.defaultLevel;
7088
7093
  })["catch"](function (error) {
7089
7094
  // eslint-disable-next-line no-console
7090
7095
  console.error('Could not load logging levels: ', error);
@@ -7290,8 +7295,16 @@ var Logger = /*#__PURE__*/function () {
7290
7295
  }, {
7291
7296
  key: "min",
7292
7297
  value: function min(level) {
7293
- var configuredLevel = this.logging.levels[this.name] || this.logging.defaultLevel;
7294
- return LogLevelPriorities[configuredLevel.toLowerCase()] >= LogLevelPriorities[level.toLowerCase()];
7298
+ level = level.toLowerCase();
7299
+ var globalLevel = this.logging.globalLevel;
7300
+ var loggerLevel = this.logging.levels[this.name];
7301
+ if (globalLevel && LogLevelPriorities[globalLevel.toLowerCase()] < LogLevelPriorities[level]) {
7302
+ return false;
7303
+ }
7304
+ if (!loggerLevel) {
7305
+ return true;
7306
+ }
7307
+ return LogLevelPriorities[loggerLevel.toLowerCase()] >= LogLevelPriorities[level];
7295
7308
  }
7296
7309
  }]);
7297
7310
  return Logger;