@microsoft/applicationinsights-react-js 3.2.2-nightly.2111-10 → 3.2.2-nightly.2111-15

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,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - React Plugin, 3.2.2-nightly.2111-10
2
+ * Application Insights JavaScript SDK - React Plugin, 3.2.2-nightly.2111-15
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -821,6 +821,22 @@
821
821
  return objectTypeDump + propertyValueDump;
822
822
  }
823
823
 
824
+ var _aiNamespace = null;
825
+ function _getExtensionNamespace() {
826
+ var target = getGlobalInst("Microsoft");
827
+ if (target) {
828
+ _aiNamespace = target["ApplicationInsights"];
829
+ }
830
+ return _aiNamespace;
831
+ }
832
+ function getDebugExt(config) {
833
+ var ns = _aiNamespace;
834
+ if (!ns && config.disableDbgExt !== true) {
835
+ ns = _aiNamespace || _getExtensionNamespace();
836
+ }
837
+ return ns ? ns["ChromeDbgExt"] : null;
838
+ }
839
+
824
840
  var AiNonUserActionablePrefix = "AI (Internal): ";
825
841
  var AiUserActionablePrefix = "AI: ";
826
842
  var AIInternalMessagePrefix = "AITR_";
@@ -904,13 +920,18 @@
904
920
  }
905
921
  _self.logInternalMessage(severity, message);
906
922
  }
923
+ else {
924
+ _debugExtMsg("throw" + (severity === LoggingSeverity.CRITICAL ? "Critical" : "Warning"), message);
925
+ }
907
926
  }
908
927
  };
909
928
  _self.warnToConsole = function (message) {
910
929
  _logToConsole("warn", message);
930
+ _debugExtMsg("warning", message);
911
931
  };
912
932
  _self.errorToConsole = function (message) {
913
933
  _logToConsole("error", message);
934
+ _debugExtMsg("error", message);
914
935
  };
915
936
  _self.resetInternalMessageCount = function () {
916
937
  _messageCount = 0;
@@ -932,12 +953,18 @@
932
953
  if (severity <= _self.telemetryLoggingLevel()) {
933
954
  _self.queue.push(message);
934
955
  _messageCount++;
956
+ _debugExtMsg((severity === LoggingSeverity.CRITICAL ? "error" : "warn"), message);
935
957
  }
936
958
  if (_messageCount === _self.maxInternalMessageLimit()) {
937
959
  var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
938
960
  var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);
939
961
  _self.queue.push(throttleMessage);
940
- _self.warnToConsole(throttleLimitMessage);
962
+ if (severity === LoggingSeverity.CRITICAL) {
963
+ _self.errorToConsole(throttleLimitMessage);
964
+ }
965
+ else {
966
+ _self.warnToConsole(throttleLimitMessage);
967
+ }
941
968
  }
942
969
  }
943
970
  };
@@ -951,6 +978,12 @@
951
978
  function _areInternalMessagesThrottled() {
952
979
  return _messageCount >= _self.maxInternalMessageLimit();
953
980
  }
981
+ function _debugExtMsg(name, data) {
982
+ var dbgExt = getDebugExt(config);
983
+ if (dbgExt && dbgExt.diagLog) {
984
+ dbgExt.diagLog(name, data);
985
+ }
986
+ }
954
987
  });
955
988
  }
956
989
  return DiagnosticLogger;