@microsoft/applicationinsights-analytics-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 JavaScript SDK - Web Analytics, 2.7.1-nightly.202110-14
2
+ * Microsoft Application Insights JavaScript SDK - Web Analytics, 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 - Web Analytics, 2.7.1-nightly.202110-14
2
+ * Application Insights JavaScript SDK - Web Analytics, 2.7.1-nightly.202110-18
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -714,12 +714,26 @@
714
714
  var AiNonUserActionablePrefix = "AI (Internal): ";
715
715
  var AiUserActionablePrefix = "AI: ";
716
716
  var AIInternalMessagePrefix = "AITR_";
717
+ var strErrorToConsole = "errorToConsole";
718
+ var strWarnToConsole = "warnToConsole";
717
719
  function _sanitizeDiagnosticText(text) {
718
720
  if (text) {
719
721
  return "\"" + text.replace(/\"/g, "") + "\"";
720
722
  }
721
723
  return "";
722
724
  }
725
+ function _logToConsole(func, message) {
726
+ var theConsole = getConsole();
727
+ if (!!theConsole) {
728
+ var logFunc = "log";
729
+ if (theConsole[func]) {
730
+ logFunc = func;
731
+ }
732
+ if (isFunction(theConsole[logFunc])) {
733
+ theConsole[logFunc](message);
734
+ }
735
+ }
736
+ }
723
737
  var _InternalLogMessage = /** @class */ (function () {
724
738
  function _InternalLogMessage(msgId, msg, isUserAct, properties) {
725
739
  if (isUserAct === void 0) { isUserAct = false; }
@@ -763,18 +777,19 @@
763
777
  throw message;
764
778
  }
765
779
  else {
780
+ var logFunc = severity === LoggingSeverity.CRITICAL ? strErrorToConsole : strWarnToConsole;
766
781
  if (!isUndefined(message.message)) {
767
782
  var logLevel = _self.consoleLoggingLevel();
768
783
  if (isUserAct) {
769
784
  var messageKey = +message.messageId;
770
- if (!_messageLogged[messageKey] && logLevel >= LoggingSeverity.WARNING) {
771
- _self.warnToConsole(message.message);
785
+ if (!_messageLogged[messageKey] && logLevel >= severity) {
786
+ _self[logFunc](message.message);
772
787
  _messageLogged[messageKey] = true;
773
788
  }
774
789
  }
775
790
  else {
776
- if (logLevel >= LoggingSeverity.WARNING) {
777
- _self.warnToConsole(message.message);
791
+ if (logLevel >= severity) {
792
+ _self[logFunc](message.message);
778
793
  }
779
794
  }
780
795
  _self.logInternalMessage(severity, message);
@@ -782,16 +797,10 @@
782
797
  }
783
798
  };
784
799
  _self.warnToConsole = function (message) {
785
- var theConsole = getConsole();
786
- if (!!theConsole) {
787
- var logFunc = "log";
788
- if (theConsole.warn) {
789
- logFunc = "warn";
790
- }
791
- if (isFunction(theConsole[logFunc])) {
792
- theConsole[logFunc](message);
793
- }
794
- }
800
+ _logToConsole("warn", message);
801
+ };
802
+ _self.errorToConsole = function (message) {
803
+ _logToConsole("error", message);
795
804
  };
796
805
  _self.resetInternalMessageCount = function () {
797
806
  _messageCount = 0;
@@ -3397,7 +3406,7 @@
3397
3406
  config.disableFlushOnUnload = stringToBoolOrDefault(config.disableFlushOnUnload, config.disableFlushOnBeforeUnload);
3398
3407
  return config;
3399
3408
  };
3400
- ApplicationInsights.Version = "2.7.1-nightly.202110-14";
3409
+ ApplicationInsights.Version = "2.7.1-nightly.202110-18";
3401
3410
  return ApplicationInsights;
3402
3411
  }(BaseTelemetryPlugin));
3403
3412
  var Timing = /** @class */ (function () {