@microsoft/applicationinsights-properties-js 2.7.1-nightly.202110-14 → 2.7.1-nightly.202110-18

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,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.18.11",
4
+ "toolVersion": "7.18.16",
5
5
  "schemaVersion": 1004,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights properties plugin, 2.7.1-nightly.202110-14
2
+ * Microsoft Application Insights properties plugin, 2.7.1-nightly.202110-18
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Properties Plugin, 2.7.1-nightly.202110-14
2
+ * Application Insights JavaScript SDK - Properties Plugin, 2.7.1-nightly.202110-18
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -721,12 +721,26 @@
721
721
  var AiNonUserActionablePrefix = "AI (Internal): ";
722
722
  var AiUserActionablePrefix = "AI: ";
723
723
  var AIInternalMessagePrefix = "AITR_";
724
+ var strErrorToConsole = "errorToConsole";
725
+ var strWarnToConsole = "warnToConsole";
724
726
  function _sanitizeDiagnosticText(text) {
725
727
  if (text) {
726
728
  return "\"" + text.replace(/\"/g, "") + "\"";
727
729
  }
728
730
  return "";
729
731
  }
732
+ function _logToConsole(func, message) {
733
+ var theConsole = getConsole();
734
+ if (!!theConsole) {
735
+ var logFunc = "log";
736
+ if (theConsole[func]) {
737
+ logFunc = func;
738
+ }
739
+ if (isFunction(theConsole[logFunc])) {
740
+ theConsole[logFunc](message);
741
+ }
742
+ }
743
+ }
730
744
  var _InternalLogMessage = /** @class */ (function () {
731
745
  function _InternalLogMessage(msgId, msg, isUserAct, properties) {
732
746
  if (isUserAct === void 0) { isUserAct = false; }
@@ -770,18 +784,19 @@
770
784
  throw message;
771
785
  }
772
786
  else {
787
+ var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
773
788
  if (!isUndefined(message.message)) {
774
789
  var logLevel = _self.consoleLoggingLevel();
775
790
  if (isUserAct) {
776
791
  var messageKey = +message.messageId;
777
- if (!_messageLogged[messageKey] && logLevel >= LoggingSeverity.WARNING) {
778
- _self.warnToConsole(message.message);
792
+ if (!_messageLogged[messageKey] && logLevel >= severity) {
793
+ _self[logFunc](message.message);
779
794
  _messageLogged[messageKey] = true;
780
795
  }
781
796
  }
782
797
  else {
783
- if (logLevel >= LoggingSeverity.WARNING) {
784
- _self.warnToConsole(message.message);
798
+ if (logLevel >= severity) {
799
+ _self[logFunc](message.message);
785
800
  }
786
801
  }
787
802
  _self.logInternalMessage(severity, message);
@@ -789,16 +804,10 @@
789
804
  }
790
805
  };
791
806
  _self.warnToConsole = function (message) {
792
- var theConsole = getConsole();
793
- if (!!theConsole) {
794
- var logFunc = "log";
795
- if (theConsole.warn) {
796
- logFunc = "warn";
797
- }
798
- if (isFunction(theConsole[logFunc])) {
799
- theConsole[logFunc](message);
800
- }
801
- }
807
+ _logToConsole("warn", message);
808
+ };
809
+ _self.errorToConsole = function (message) {
810
+ _logToConsole("error", message);
802
811
  };
803
812
  _self.resetInternalMessageCount = function () {
804
813
  _messageCount = 0;
@@ -2037,7 +2046,7 @@
2037
2046
  return Device;
2038
2047
  }());
2039
2048
 
2040
- var Version = "2.7.1-nightly.202110-14";
2049
+ var Version = "2.7.1-nightly.202110-18";
2041
2050
  var Internal = /** @class */ (function () {
2042
2051
  function Internal(config) {
2043
2052
  this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version;