@microsoft/applicationinsights-react-native 2.4.2-nightly.2111-08 → 2.4.2-nightly.2111-13

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 Native Plugin, 2.4.2-nightly.2111-08
2
+ * Application Insights JavaScript SDK - React Native Plugin, 2.4.2-nightly.2111-13
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -540,6 +540,22 @@
540
540
  return objectTypeDump + propertyValueDump;
541
541
  }
542
542
 
543
+ var _aiNamespace = null;
544
+ function _getExtensionNamespace() {
545
+ var target = getGlobalInst("Microsoft");
546
+ if (target) {
547
+ _aiNamespace = target["ApplicationInsights"];
548
+ }
549
+ return _aiNamespace;
550
+ }
551
+ function getDebugExt(config) {
552
+ var ns = _aiNamespace;
553
+ if (!ns && config.disableDbgExt !== true) {
554
+ ns = _aiNamespace || _getExtensionNamespace();
555
+ }
556
+ return ns ? ns["ChromeDbgExt"] : null;
557
+ }
558
+
543
559
  var AiNonUserActionablePrefix = "AI (Internal): ";
544
560
  var AiUserActionablePrefix = "AI: ";
545
561
  var AIInternalMessagePrefix = "AITR_";
@@ -623,13 +639,18 @@
623
639
  }
624
640
  _self.logInternalMessage(severity, message);
625
641
  }
642
+ else {
643
+ _debugExtMsg("throw" + (severity === LoggingSeverity.CRITICAL ? "Critical" : "Warning"), message);
644
+ }
626
645
  }
627
646
  };
628
647
  _self.warnToConsole = function (message) {
629
648
  _logToConsole("warn", message);
649
+ _debugExtMsg("warning", message);
630
650
  };
631
651
  _self.errorToConsole = function (message) {
632
652
  _logToConsole("error", message);
653
+ _debugExtMsg("error", message);
633
654
  };
634
655
  _self.resetInternalMessageCount = function () {
635
656
  _messageCount = 0;
@@ -651,12 +672,18 @@
651
672
  if (severity <= _self.telemetryLoggingLevel()) {
652
673
  _self.queue.push(message);
653
674
  _messageCount++;
675
+ _debugExtMsg((severity === LoggingSeverity.CRITICAL ? "error" : "warn"), message);
654
676
  }
655
677
  if (_messageCount === _self.maxInternalMessageLimit()) {
656
678
  var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app.";
657
679
  var throttleMessage = new _InternalLogMessage(_InternalMessageId.MessageLimitPerPVExceeded, throttleLimitMessage, false);
658
680
  _self.queue.push(throttleMessage);
659
- _self.warnToConsole(throttleLimitMessage);
681
+ if (severity === LoggingSeverity.CRITICAL) {
682
+ _self.errorToConsole(throttleLimitMessage);
683
+ }
684
+ else {
685
+ _self.warnToConsole(throttleLimitMessage);
686
+ }
660
687
  }
661
688
  }
662
689
  };
@@ -670,6 +697,12 @@
670
697
  function _areInternalMessagesThrottled() {
671
698
  return _messageCount >= _self.maxInternalMessageLimit();
672
699
  }
700
+ function _debugExtMsg(name, data) {
701
+ var dbgExt = getDebugExt(config);
702
+ if (dbgExt && dbgExt.diagLog) {
703
+ dbgExt.diagLog(name, data);
704
+ }
705
+ }
673
706
  });
674
707
  }
675
708
  return DiagnosticLogger;