backendless 7.0.1 → 7.0.2

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.
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * ********************************************************************************************************************
3
- * Backendless SDK for JavaScript. Version: 7.0.1
3
+ * Backendless SDK for JavaScript. Version: 7.0.2
4
4
  *
5
5
  * Copyright 2012-2023 BACKENDLESS.COM. All Rights Reserved.
6
6
  *
@@ -7046,12 +7046,19 @@ var Logging = /*#__PURE__*/function () {
7046
7046
  (0, _classCallCheck2["default"])(this, Logging);
7047
7047
  this.app = app;
7048
7048
  this.reset();
7049
- this.setConfig(app.loggingConfig);
7049
+ if (app.loggingConfig) {
7050
+ this.setConfig(app.loggingConfig);
7051
+ }
7050
7052
  }
7051
7053
  (0, _createClass2["default"])(Logging, [{
7052
7054
  key: "setConfig",
7053
7055
  value: function setConfig(config) {
7054
- this.config = config;
7056
+ if (config.levels) {
7057
+ this.levels = config.levels;
7058
+ }
7059
+ if (config.defaultLevel) {
7060
+ this.defaultLevel = config.defaultLevel;
7061
+ }
7055
7062
  if (config.loadLevels) {
7056
7063
  this.loadLoggingLevels();
7057
7064
  }
@@ -7059,6 +7066,8 @@ var Logging = /*#__PURE__*/function () {
7059
7066
  }, {
7060
7067
  key: "reset",
7061
7068
  value: function reset() {
7069
+ this.levels = {};
7070
+ this.defaultLevel = 'all';
7062
7071
  this.loggers = {};
7063
7072
  this.messages = [];
7064
7073
  this.numOfMessages = 10;
@@ -7073,9 +7082,9 @@ var Logging = /*#__PURE__*/function () {
7073
7082
  url: this.app.urls.loggingLevels()
7074
7083
  }).then(function (loggers) {
7075
7084
  loggers.forEach(function (logger) {
7076
- _this.config.levels[logger.name] = logger.level;
7085
+ _this.levels[logger.name] = logger.level;
7077
7086
  });
7078
- _this.config.defaultLevel = _this.config.levels[GLOBAL_LOGGER_NAME] || _this.config.defaultLevel;
7087
+ _this.defaultLevel = _this.levels[GLOBAL_LOGGER_NAME] || _this.defaultLevel;
7079
7088
  })["catch"](function (error) {
7080
7089
  // eslint-disable-next-line no-console
7081
7090
  console.error('Could not load logging levels: ', error);
@@ -7274,11 +7283,7 @@ var Logger = /*#__PURE__*/function () {
7274
7283
  }, {
7275
7284
  key: "min",
7276
7285
  value: function min(level) {
7277
- var configuredLevel = this.logging.config.levels[this.name];
7278
- if (!configuredLevel) {
7279
- var defaultLevel = this.logging.config.defaultLevel;
7280
- return LogLevelPriorities[defaultLevel.toLowerCase()] >= LogLevelPriorities[level.toLowerCase()];
7281
- }
7286
+ var configuredLevel = this.logging.levels[this.name] || this.logging.defaultLevel;
7282
7287
  return LogLevelPriorities[configuredLevel.toLowerCase()] >= LogLevelPriorities[level.toLowerCase()];
7283
7288
  }
7284
7289
  }]);