@microsoft/sp-diagnostics 1.23.1 → 1.24.0-beta.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.
- package/dist/78359e4b-07c2-43c6-8d0b-d060b4d577e8.manifest.json +6 -11
- package/dist/index-internal-beta.d.ts +20 -0
- package/dist/index-internal-public.d.ts +20 -0
- package/dist/index-internal.d.ts +20 -0
- package/dist/sp-diagnostics_none_1b5b73722b91f3231f63.js +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Api/Engagement/EngagementLogger.js +91 -96
- package/lib-commonjs/Api/Engagement/IEngagementHandler.js +9 -3
- package/lib-commonjs/Api/ExecutionQueue.js +73 -86
- package/lib-commonjs/Api/ILogData.js +6 -3
- package/lib-commonjs/Api/ILogEntry.js +5 -2
- package/lib-commonjs/Api/ILogErrorData.js +6 -3
- package/lib-commonjs/Api/ILogSource.js +10 -3
- package/lib-commonjs/Api/ILogVerboseData.js +6 -3
- package/lib-commonjs/Api/Log/LogHandler.js +27 -26
- package/lib-commonjs/Api/LogEntry.js +40 -39
- package/lib-commonjs/Api/LogFeature.js +14 -10
- package/lib-commonjs/Api/LogLevel.js +22 -19
- package/lib-commonjs/Api/LogManager/CircularBuffer.js +56 -64
- package/lib-commonjs/Api/LogManager/LogManager.js +61 -78
- package/lib-commonjs/Api/LogSource.js +37 -35
- package/lib-commonjs/Api/LogType.js +20 -15
- package/lib-commonjs/Api/Qos/AutoAlertableQosMonitor.js +68 -82
- package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +5 -2
- package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +5 -2
- package/lib-commonjs/Api/Qos/IQos.js +5 -2
- package/lib-commonjs/Api/Qos/IQosEndEvent.js +5 -2
- package/lib-commonjs/Api/Qos/IQosExtraData.js +15 -3
- package/lib-commonjs/Api/Qos/IQosStartEvent.js +9 -3
- package/lib-commonjs/Api/Qos/QosLogger.js +54 -60
- package/lib-commonjs/Api/Qos/QosMonitor.js +163 -209
- package/lib-commonjs/Api/Qos/QosMonitorShareFailureWithCP.js +72 -92
- package/lib-commonjs/Api/Qos/QosResultType.js +14 -7
- package/lib-commonjs/Api/Trace/DefaultTraceHandler.js +20 -22
- package/lib-commonjs/Api/Trace/ITraceHandler.js +9 -3
- package/lib-commonjs/Api/Trace/ITraceLogger.js +5 -2
- package/lib-commonjs/Api/Trace/LogEvent.js +86 -125
- package/lib-commonjs/Api/Trace/TraceLogger.js +149 -161
- package/lib-commonjs/Diagnostics.js +57 -72
- package/lib-commonjs/DiagnosticsSettingsManager.js +37 -43
- package/lib-commonjs/IDiagnosticsSettings.js +5 -2
- package/lib-commonjs/common/Killswitches.js +13 -9
- package/lib-commonjs/extraData/DisplayApp.js +13 -5
- package/lib-commonjs/extraData/IDiagnosticContextInfo.js +5 -2
- package/lib-commonjs/extraData/IPageExtraData.js +5 -2
- package/lib-commonjs/extraData/PageType.js +15 -8
- package/lib-commonjs/extraData/PromotedState.js +18 -13
- package/lib-commonjs/extraData/WebTemplateId.js +13 -5
- package/lib-commonjs/extraData/setPageExtraData.js +37 -37
- package/lib-commonjs/index.js +102 -50
- package/{lib → lib-dts}/Api/Engagement/IEngagementHandler.d.ts +2 -0
- package/lib-esm/Api/Engagement/EngagementLogger.js +137 -0
- package/lib-esm/Api/Engagement/IEngagementHandler.js +9 -0
- package/lib-esm/Api/ExecutionQueue.js +114 -0
- package/lib-esm/Api/ILogData.js +4 -0
- package/lib-esm/Api/ILogEntry.js +3 -0
- package/lib-esm/Api/ILogErrorData.js +4 -0
- package/lib-esm/Api/ILogSource.js +8 -0
- package/lib-esm/Api/ILogVerboseData.js +4 -0
- package/lib-esm/Api/Log/LogHandler.js +37 -0
- package/lib-esm/Api/LogEntry.js +44 -0
- package/lib-esm/Api/LogFeature.js +8 -0
- package/lib-esm/Api/LogLevel.js +20 -0
- package/lib-esm/Api/LogManager/CircularBuffer.js +83 -0
- package/lib-esm/Api/LogManager/LogManager.js +103 -0
- package/lib-esm/Api/LogSource.js +32 -0
- package/lib-esm/Api/LogType.js +20 -0
- package/lib-esm/Api/Qos/AutoAlertableQosMonitor.js +74 -0
- package/lib-esm/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +6 -0
- package/lib-esm/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +6 -0
- package/lib-esm/Api/Qos/IQos.js +6 -0
- package/lib-esm/Api/Qos/IQosEndEvent.js +6 -0
- package/lib-esm/Api/Qos/IQosExtraData.js +12 -0
- package/lib-esm/Api/Qos/IQosStartEvent.js +6 -0
- package/lib-esm/Api/Qos/QosLogger.js +64 -0
- package/lib-esm/Api/Qos/QosMonitor.js +258 -0
- package/lib-esm/Api/Qos/QosMonitorShareFailureWithCP.js +89 -0
- package/lib-esm/Api/Qos/QosResultType.js +11 -0
- package/lib-esm/Api/Trace/DefaultTraceHandler.js +23 -0
- package/lib-esm/Api/Trace/ITraceHandler.js +9 -0
- package/lib-esm/Api/Trace/ITraceLogger.js +3 -0
- package/lib-esm/Api/Trace/LogEvent.js +104 -0
- package/lib-esm/Api/Trace/TraceLogger.js +180 -0
- package/lib-esm/Diagnostics.js +67 -0
- package/lib-esm/DiagnosticsSettingsManager.js +54 -0
- package/lib-esm/IDiagnosticsSettings.js +3 -0
- package/{lib → lib-esm}/common/Killswitches.js +3 -4
- package/{lib → lib-esm}/extraData/DisplayApp.js +3 -2
- package/lib-esm/extraData/IDiagnosticContextInfo.js +7 -0
- package/lib-esm/extraData/IPageExtraData.js +3 -0
- package/{lib → lib-esm}/extraData/PageType.js +4 -4
- package/lib-esm/extraData/PromotedState.js +15 -0
- package/{lib → lib-esm}/extraData/WebTemplateId.js +3 -2
- package/{lib → lib-esm}/extraData/setPageExtraData.js +14 -20
- package/{lib → lib-esm}/index.js +3 -3
- package/package.json +33 -6
- package/dist/sp-diagnostics_none_e7447a590b1864b48fbc.js +0 -1
- package/lib/Api/Engagement/EngagementLogger.d.ts.map +0 -1
- package/lib/Api/Engagement/EngagementLogger.js +0 -143
- package/lib/Api/Engagement/IEngagementHandler.d.ts.map +0 -1
- package/lib/Api/Engagement/IEngagementHandler.js +0 -2
- package/lib/Api/ExecutionQueue.d.ts.map +0 -1
- package/lib/Api/ExecutionQueue.js +0 -131
- package/lib/Api/ILogData.d.ts.map +0 -1
- package/lib/Api/ILogData.js +0 -3
- package/lib/Api/ILogEntry.d.ts.map +0 -1
- package/lib/Api/ILogEntry.js +0 -2
- package/lib/Api/ILogErrorData.d.ts.map +0 -1
- package/lib/Api/ILogErrorData.js +0 -3
- package/lib/Api/ILogSource.d.ts.map +0 -1
- package/lib/Api/ILogSource.js +0 -3
- package/lib/Api/ILogVerboseData.d.ts.map +0 -1
- package/lib/Api/ILogVerboseData.js +0 -3
- package/lib/Api/Log/LogHandler.d.ts.map +0 -1
- package/lib/Api/Log/LogHandler.js +0 -40
- package/lib/Api/LogEntry.d.ts.map +0 -1
- package/lib/Api/LogEntry.js +0 -51
- package/lib/Api/LogFeature.d.ts.map +0 -1
- package/lib/Api/LogFeature.js +0 -11
- package/lib/Api/LogLevel.d.ts.map +0 -1
- package/lib/Api/LogLevel.js +0 -24
- package/lib/Api/LogManager/CircularBuffer.d.ts.map +0 -1
- package/lib/Api/LogManager/CircularBuffer.js +0 -98
- package/lib/Api/LogManager/LogManager.d.ts.map +0 -1
- package/lib/Api/LogManager/LogManager.js +0 -121
- package/lib/Api/LogSource.d.ts.map +0 -1
- package/lib/Api/LogSource.js +0 -40
- package/lib/Api/LogType.d.ts.map +0 -1
- package/lib/Api/LogType.js +0 -23
- package/lib/Api/Qos/AutoAlertableQosMonitor.d.ts.map +0 -1
- package/lib/Api/Qos/AutoAlertableQosMonitor.js +0 -93
- package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts.map +0 -1
- package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +0 -2
- package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts.map +0 -1
- package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +0 -2
- package/lib/Api/Qos/IQos.d.ts.map +0 -1
- package/lib/Api/Qos/IQos.js +0 -2
- package/lib/Api/Qos/IQosEndEvent.d.ts.map +0 -1
- package/lib/Api/Qos/IQosEndEvent.js +0 -2
- package/lib/Api/Qos/IQosExtraData.d.ts.map +0 -1
- package/lib/Api/Qos/IQosExtraData.js +0 -2
- package/lib/Api/Qos/IQosStartEvent.d.ts.map +0 -1
- package/lib/Api/Qos/IQosStartEvent.js +0 -2
- package/lib/Api/Qos/QosLogger.d.ts.map +0 -1
- package/lib/Api/Qos/QosLogger.js +0 -74
- package/lib/Api/Qos/QosMonitor.d.ts.map +0 -1
- package/lib/Api/Qos/QosMonitor.js +0 -304
- package/lib/Api/Qos/QosMonitorShareFailureWithCP.d.ts.map +0 -1
- package/lib/Api/Qos/QosMonitorShareFailureWithCP.js +0 -114
- package/lib/Api/Qos/QosResultType.d.ts.map +0 -1
- package/lib/Api/Qos/QosResultType.js +0 -11
- package/lib/Api/Trace/DefaultTraceHandler.d.ts.map +0 -1
- package/lib/Api/Trace/DefaultTraceHandler.js +0 -30
- package/lib/Api/Trace/ITraceHandler.d.ts.map +0 -1
- package/lib/Api/Trace/ITraceHandler.js +0 -2
- package/lib/Api/Trace/ITraceLogger.d.ts.map +0 -1
- package/lib/Api/Trace/ITraceLogger.js +0 -2
- package/lib/Api/Trace/LogEvent.d.ts.map +0 -1
- package/lib/Api/Trace/LogEvent.js +0 -147
- package/lib/Api/Trace/TraceLogger.d.ts.map +0 -1
- package/lib/Api/Trace/TraceLogger.js +0 -196
- package/lib/Diagnostics.d.ts.map +0 -1
- package/lib/Diagnostics.js +0 -82
- package/lib/DiagnosticsSettingsManager.d.ts.map +0 -1
- package/lib/DiagnosticsSettingsManager.js +0 -62
- package/lib/IDiagnosticsSettings.d.ts.map +0 -1
- package/lib/IDiagnosticsSettings.js +0 -2
- package/lib/common/Killswitches.d.ts.map +0 -1
- package/lib/extraData/DisplayApp.d.ts.map +0 -1
- package/lib/extraData/IDiagnosticContextInfo.d.ts.map +0 -1
- package/lib/extraData/IDiagnosticContextInfo.js +0 -2
- package/lib/extraData/IPageExtraData.d.ts.map +0 -1
- package/lib/extraData/IPageExtraData.js +0 -2
- package/lib/extraData/PageType.d.ts.map +0 -1
- package/lib/extraData/PromotedState.d.ts.map +0 -1
- package/lib/extraData/PromotedState.js +0 -17
- package/lib/extraData/WebTemplateId.d.ts.map +0 -1
- package/lib/extraData/setPageExtraData.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- /package/{lib → lib-dts}/Api/Engagement/EngagementLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ExecutionQueue.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogEntry.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogErrorData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogSource.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogVerboseData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Log/LogHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogEntry.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogFeature.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogLevel.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogManager/CircularBuffer.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogManager/LogManager.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogSource.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogType.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/AutoAlertableQosMonitor.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQos.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosEndEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosStartEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosMonitor.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosMonitorShareFailureWithCP.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosResultType.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/DefaultTraceHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/ITraceHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/ITraceLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/LogEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/TraceLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Diagnostics.d.ts +0 -0
- /package/{lib → lib-dts}/DiagnosticsSettingsManager.d.ts +0 -0
- /package/{lib → lib-dts}/IDiagnosticsSettings.d.ts +0 -0
- /package/{lib → lib-dts}/common/Killswitches.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/DisplayApp.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/IDiagnosticContextInfo.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/IPageExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/PageType.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/PromotedState.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/WebTemplateId.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/setPageExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-esm}/sp-diagnostics.manifest.json +0 -0
|
@@ -1,117 +1,97 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Monitor which handles failures for QosMonitor and also invokes Customer Promise Handlers to record failure
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
var QosMonitorShareFailureWithCP = /** @class */ (function (_super) {
|
|
14
|
-
tslib_1.__extends(QosMonitorShareFailureWithCP, _super);
|
|
15
|
-
/**
|
|
16
|
-
* Creates a QoS monitor and also registers the Customer promise handlers to notify in case of failures
|
|
17
|
-
* @internal
|
|
18
|
-
*
|
|
19
|
-
* @param scenarioName - Unique name of the QoS scenario
|
|
20
|
-
* @param copyToEngagement - indicate whether this data should be used as Engagement as well.
|
|
21
|
-
* @param extraDataForCustomerPromise - Holds extra information about Customer Promise handlers to invoke
|
|
22
|
-
* and error information where failures are logged
|
|
23
|
-
*/
|
|
24
|
-
function QosMonitorShareFailureWithCP(scenarioName, copyToEngagement, extraDataForCustomerPromise, copyToCosmos) {
|
|
25
|
-
if (copyToEngagement === void 0) { copyToEngagement = false; }
|
|
26
|
-
if (copyToCosmos === void 0) { copyToCosmos = false; }
|
|
27
|
-
var _this = _super.call(this, scenarioName, /* copyToCosmos */ copyToCosmos, /* copyToInterana */ copyToEngagement) || this;
|
|
28
|
-
_this._extraDataForCustomerPromise = extraDataForCustomerPromise;
|
|
29
|
-
return _this;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "QosMonitorShareFailureWithCP", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return QosMonitorShareFailureWithCP;
|
|
30
9
|
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _QosMonitor = /*#__PURE__*/ _interop_require_default._(require("./QosMonitor"));
|
|
13
|
+
const _QosResultType = require("./QosResultType");
|
|
14
|
+
const _Diagnostics = /*#__PURE__*/ _interop_require_default._(require("../../Diagnostics"));
|
|
15
|
+
const _Killswitches = require("../../common/Killswitches");
|
|
16
|
+
class QosMonitorShareFailureWithCP extends _QosMonitor.default {
|
|
31
17
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
QosMonitorShareFailureWithCP.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
* QoS monitor ends with failure and invokes the Customer Promise handlers
|
|
19
|
+
* to log a failure
|
|
20
|
+
* @internal
|
|
21
|
+
*
|
|
22
|
+
* You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
|
|
23
|
+
* <failuretag> will be filled with param tagName
|
|
24
|
+
*/ writeUnexpectedFailure(tagNameSuffix = 'DefaultUnexpected', ex, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
25
|
extraData) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
26
|
+
super.writeUnexpectedFailure(tagNameSuffix, ex, extraData);
|
|
27
|
+
this._logCustomerPromiseFailure(ex?.message || 'DefaultErrorMessage', tagNameSuffix, _QosResultType.QosResultType.Failure, extraData);
|
|
28
|
+
}
|
|
46
29
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
extraData, skipLoggingCustomerPromiseFailure) {
|
|
57
|
-
if (tagNameSuffix === void 0) { tagNameSuffix = 'DefaultExpected'; }
|
|
58
|
-
if (skipLoggingCustomerPromiseFailure === void 0) { skipLoggingCustomerPromiseFailure = false; }
|
|
59
|
-
_super.prototype.writeExpectedFailure.call(this, tagNameSuffix, ex, extraData);
|
|
30
|
+
* QoS monitor ends with expected failure and invokes the Customer Promise handlers
|
|
31
|
+
* to log an expected failure
|
|
32
|
+
* @internal
|
|
33
|
+
*
|
|
34
|
+
* You will see success tag: ModernPublish.RenderPublishPage.<failuretag>.ExpectedFailure.
|
|
35
|
+
* <failuretag> will be filled with param tagName
|
|
36
|
+
*/ writeExpectedFailure(tagNameSuffix = 'DefaultExpected', ex, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
extraData, skipLoggingCustomerPromiseFailure = false) {
|
|
38
|
+
super.writeExpectedFailure(tagNameSuffix, ex, extraData);
|
|
60
39
|
if (!skipLoggingCustomerPromiseFailure) {
|
|
61
|
-
this._logCustomerPromiseFailure(
|
|
40
|
+
this._logCustomerPromiseFailure(ex?.message || 'DefaultErrorMessage', tagNameSuffix, _QosResultType.QosResultType.ExpectedFailure, extraData);
|
|
62
41
|
}
|
|
63
|
-
}
|
|
42
|
+
}
|
|
64
43
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
QosMonitorShareFailureWithCP.prototype._logCustomerPromiseFailure = function (errorMessage, errorScenario, resultType,
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
* Invokes the registered Customer Promise Handlers by using the passed in serviceKey
|
|
45
|
+
* @param errorMessage - Information to indicate which scenario failed.
|
|
46
|
+
* @param errorScenario -Additional error details describing the failure from the module.
|
|
47
|
+
* @param resultType - ResultTypeEnum used to indicate expected or unexpected failure.
|
|
48
|
+
* @param extraData - Additional information to be logged, which might include pageType and/or errorStack
|
|
49
|
+
*/ _logCustomerPromiseFailure(errorMessage, errorScenario, resultType = _QosResultType.QosResultType.Failure, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
50
|
extraData) {
|
|
74
|
-
if (resultType === void 0) { resultType = QosResultType_1.QosResultType.Failure; }
|
|
75
51
|
if (this._extraDataForCustomerPromise) {
|
|
76
|
-
this._extraDataForCustomerPromise.forEach(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(!(0, Killswitches_1.isAppendSuffixIfBrowserIsOfflineAtLoggingTimeKsActive)() ? getOfflineSuffix() : '');
|
|
81
|
-
var errorDetailsForCP = {
|
|
52
|
+
this._extraDataForCustomerPromise.forEach((extraHandlerInfo)=>{
|
|
53
|
+
const { logFailure, veto } = extraHandlerInfo;
|
|
54
|
+
const errorModuleName = extraHandlerInfo.errorModuleName + getAuthoringSuffix() + (!(0, _Killswitches.isAppendSuffixIfBrowserIsOfflineAtLoggingTimeKsActive)() ? getOfflineSuffix() : '');
|
|
55
|
+
const errorDetailsForCP = {
|
|
82
56
|
errorCode: errorModuleName,
|
|
83
|
-
errorScenario
|
|
84
|
-
errorMessage
|
|
85
|
-
resultType
|
|
86
|
-
pageType: extraData
|
|
87
|
-
errorStack: extraData
|
|
88
|
-
veto
|
|
57
|
+
errorScenario,
|
|
58
|
+
errorMessage,
|
|
59
|
+
resultType,
|
|
60
|
+
pageType: extraData?.pageType,
|
|
61
|
+
errorStack: extraData?.errorStack,
|
|
62
|
+
veto
|
|
89
63
|
};
|
|
90
64
|
logFailure(errorDetailsForCP);
|
|
91
65
|
});
|
|
92
66
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates a QoS monitor and also registers the Customer promise handlers to notify in case of failures
|
|
70
|
+
* @internal
|
|
71
|
+
*
|
|
72
|
+
* @param scenarioName - Unique name of the QoS scenario
|
|
73
|
+
* @param copyToEngagement - indicate whether this data should be used as Engagement as well.
|
|
74
|
+
* @param extraDataForCustomerPromise - Holds extra information about Customer Promise handlers to invoke
|
|
75
|
+
* and error information where failures are logged
|
|
76
|
+
*/ constructor(scenarioName, copyToEngagement = false, extraDataForCustomerPromise, copyToCosmos = false){
|
|
77
|
+
super(scenarioName, /* copyToCosmos */ copyToCosmos, /* copyToInterana */ copyToEngagement);
|
|
78
|
+
this._extraDataForCustomerPromise = extraDataForCustomerPromise;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
97
81
|
function getAuthoringSuffix() {
|
|
98
|
-
|
|
82
|
+
const extraDiagnosticInfo = _Diagnostics.default._getExtraDiagnosticInfo();
|
|
99
83
|
if (!extraDiagnosticInfo || !extraDiagnosticInfo.hasAuthoringStarted) {
|
|
100
84
|
return '';
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
? " in Legacy Authoring (DDS)"
|
|
105
|
-
: ' in Legacy Authoring (no DDS)';
|
|
106
|
-
}
|
|
107
|
-
else if (extraDiagnosticInfo.authoringSessionClientCount > 1) {
|
|
85
|
+
} else if (!extraDiagnosticInfo.authoringSessionClientCount) {
|
|
86
|
+
return extraDiagnosticInfo.isAuthoringUsingDDS ? ` in Legacy Authoring (DDS)` : ' in Legacy Authoring (no DDS)';
|
|
87
|
+
} else if (extraDiagnosticInfo.authoringSessionClientCount > 1) {
|
|
108
88
|
return ' with Multiple Users';
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
89
|
+
} else {
|
|
111
90
|
return '';
|
|
112
91
|
}
|
|
113
92
|
}
|
|
114
93
|
function getOfflineSuffix() {
|
|
115
94
|
return window.navigator.onLine ? '' : ' (offline)';
|
|
116
95
|
}
|
|
117
|
-
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=./QosMonitorShareFailureWithCP.js.map
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QosResultType = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Qos Result Type const object.
|
|
6
3
|
* @internal
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
exports
|
|
4
|
+
*/ // eslint-disable-next-line @typescript-eslint/typedef
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "QosResultType", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return QosResultType;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const QosResultType = {
|
|
10
16
|
Success: 0,
|
|
11
17
|
Failure: 1,
|
|
12
18
|
ExpectedFailure: 2
|
|
13
19
|
};
|
|
14
|
-
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=./QosResultType.js.map
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return DefaultTraceHandler;
|
|
8
9
|
}
|
|
10
|
+
});
|
|
11
|
+
class DefaultTraceHandler {
|
|
9
12
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
DefaultTraceHandler.prototype.log = function (traceLogEvent) {
|
|
13
|
+
* Default implementation for log function.
|
|
14
|
+
*/ log(traceLogEvent) {
|
|
13
15
|
if (!DEPRECATED_UNIT_TEST) {
|
|
14
16
|
// eslint-disable-next-line no-console
|
|
15
|
-
console.log(
|
|
16
|
-
"Event Name: ".concat(traceLogEvent.eventName, ", ") +
|
|
17
|
-
"Result Code: ".concat(traceLogEvent.resultCode));
|
|
17
|
+
console.log(`Error: ${traceLogEvent.data}, ` + `Event Name: ${traceLogEvent.eventName}, ` + `Result Code: ${traceLogEvent.resultCode}`);
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
DefaultTraceHandler.prototype.verbose = function (verboseTraceEvent) {
|
|
21
|
+
* Default implementation for verbose function.
|
|
22
|
+
*/ verbose(verboseTraceEvent) {
|
|
24
23
|
if (!DEPRECATED_UNIT_TEST) {
|
|
25
24
|
// eslint-disable-next-line no-console
|
|
26
|
-
console.log(
|
|
25
|
+
console.log(`Error: ${verboseTraceEvent.data}, Event Name: ${verboseTraceEvent.eventName}`);
|
|
27
26
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=DefaultTraceHandler.js.map
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=./DefaultTraceHandler.js.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Trace logger log data interface
|
|
3
|
+
* @internal
|
|
4
|
+
*/ "use strict";
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=./ITraceHandler.js.map
|
|
@@ -1,150 +1,111 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
var LogEvent = /** @class */ (function () {
|
|
11
|
-
/**
|
|
12
|
-
* Do not call this constructor directly. Use LogEvent.log instead.
|
|
13
|
-
*/
|
|
14
|
-
function LogEvent(source, data, level, serviceScope) {
|
|
15
|
-
this._validate(source, data);
|
|
16
|
-
this._timestamp = new Date().getTime();
|
|
17
|
-
this._scope = this._getScope(serviceScope);
|
|
18
|
-
this._source = source.substr(0, this._maxSourceLength);
|
|
19
|
-
this._setData(data);
|
|
20
|
-
this._level = level;
|
|
21
|
-
this._prefix = this._getPrefix();
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return LogEvent;
|
|
22
9
|
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _LogSource = require("../LogSource");
|
|
13
|
+
const _LogManager = /*#__PURE__*/ _interop_require_default._(require("../LogManager/LogManager"));
|
|
14
|
+
class LogEvent {
|
|
23
15
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var event = new LogEvent(source, data, level, serviceScope);
|
|
16
|
+
* Use this method to log an event.
|
|
17
|
+
*
|
|
18
|
+
* @param source - source of the log event, e.g. class name of the source file
|
|
19
|
+
* @param data - data of the log event
|
|
20
|
+
* @param level - level of the log event
|
|
21
|
+
* @param serviceScope - scope of the log event, e.g. component/web part
|
|
22
|
+
*/ static log(source, data, level, serviceScope) {
|
|
23
|
+
const event = new LogEvent(source, data, level, serviceScope);
|
|
33
24
|
LogEvent.logManager.log(event);
|
|
34
25
|
return event;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
}
|
|
27
|
+
toString() {
|
|
28
|
+
const timedPrefix = `[${this._timestamp}][${this._prefix}]`;
|
|
38
29
|
if (this._message) {
|
|
39
|
-
return
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
30
|
+
return `${timedPrefix} ${this._message}`;
|
|
31
|
+
} else if (this._error) {
|
|
32
|
+
return `${timedPrefix} ${this._error.toString()}`;
|
|
33
|
+
} else {
|
|
45
34
|
return timedPrefix;
|
|
46
35
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Object.defineProperty(LogEvent.prototype, "source", {
|
|
77
|
-
get: function () {
|
|
78
|
-
return this._source;
|
|
79
|
-
},
|
|
80
|
-
enumerable: false,
|
|
81
|
-
configurable: true
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(LogEvent.prototype, "message", {
|
|
84
|
-
get: function () {
|
|
85
|
-
return this._message;
|
|
86
|
-
},
|
|
87
|
-
enumerable: false,
|
|
88
|
-
configurable: true
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(LogEvent.prototype, "error", {
|
|
91
|
-
get: function () {
|
|
92
|
-
return this._error;
|
|
93
|
-
},
|
|
94
|
-
enumerable: false,
|
|
95
|
-
configurable: true
|
|
96
|
-
});
|
|
97
|
-
Object.defineProperty(LogEvent.prototype, "_maxSourceLength", {
|
|
98
|
-
get: function () {
|
|
99
|
-
return 30;
|
|
100
|
-
},
|
|
101
|
-
enumerable: false,
|
|
102
|
-
configurable: true
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(LogEvent.prototype, "_maxMessageLength", {
|
|
105
|
-
get: function () {
|
|
106
|
-
return 150;
|
|
107
|
-
},
|
|
108
|
-
enumerable: false,
|
|
109
|
-
configurable: true
|
|
110
|
-
});
|
|
111
|
-
LogEvent.prototype._validate = function (source, data) {
|
|
36
|
+
}
|
|
37
|
+
get timestamp() {
|
|
38
|
+
return this._timestamp;
|
|
39
|
+
}
|
|
40
|
+
get level() {
|
|
41
|
+
return this._level;
|
|
42
|
+
}
|
|
43
|
+
get prefix() {
|
|
44
|
+
return this._prefix;
|
|
45
|
+
}
|
|
46
|
+
get scope() {
|
|
47
|
+
return this._scope;
|
|
48
|
+
}
|
|
49
|
+
get source() {
|
|
50
|
+
return this._source;
|
|
51
|
+
}
|
|
52
|
+
get message() {
|
|
53
|
+
return this._message;
|
|
54
|
+
}
|
|
55
|
+
get error() {
|
|
56
|
+
return this._error;
|
|
57
|
+
}
|
|
58
|
+
get _maxSourceLength() {
|
|
59
|
+
return 30;
|
|
60
|
+
}
|
|
61
|
+
get _maxMessageLength() {
|
|
62
|
+
return 150;
|
|
63
|
+
}
|
|
64
|
+
_validate(source, data) {
|
|
112
65
|
if (!source) {
|
|
113
66
|
throw new Error('source cannot be undefined or null for Logger');
|
|
114
67
|
}
|
|
115
68
|
if (!data) {
|
|
116
69
|
throw new Error('data cannot be undefined or null');
|
|
117
70
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
71
|
+
}
|
|
72
|
+
_setData(data) {
|
|
120
73
|
if (typeof data === 'string') {
|
|
121
74
|
this._message = data.substr(0, this._maxMessageLength);
|
|
122
|
-
}
|
|
123
|
-
else if (data instanceof Error) {
|
|
75
|
+
} else if (data instanceof Error) {
|
|
124
76
|
this._error = data;
|
|
125
77
|
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
78
|
+
}
|
|
79
|
+
_getPrefix() {
|
|
80
|
+
let prefix = `${this._source}`;
|
|
129
81
|
if (this._scope && !this._scope.isEmpty()) {
|
|
130
|
-
prefix =
|
|
82
|
+
prefix = `${this._scope.id.substr(0, this._maxSourceLength)}.${prefix}`;
|
|
131
83
|
}
|
|
132
|
-
return
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
84
|
+
return `${prefix}`;
|
|
85
|
+
}
|
|
86
|
+
_getScope(serviceScope) {
|
|
87
|
+
let parentSource;
|
|
136
88
|
if (serviceScope) {
|
|
137
|
-
serviceScope.whenFinished(
|
|
138
|
-
parentSource = serviceScope.consume(
|
|
89
|
+
serviceScope.whenFinished(()=>{
|
|
90
|
+
parentSource = serviceScope.consume(_LogSource.logSourceServiceKey);
|
|
139
91
|
});
|
|
140
92
|
}
|
|
141
93
|
return parentSource;
|
|
142
|
-
}
|
|
94
|
+
}
|
|
143
95
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
96
|
+
* Do not call this constructor directly. Use LogEvent.log instead.
|
|
97
|
+
*/ constructor(source, data, level, serviceScope){
|
|
98
|
+
this._validate(source, data);
|
|
99
|
+
this._timestamp = new Date().getTime();
|
|
100
|
+
this._scope = this._getScope(serviceScope);
|
|
101
|
+
this._source = source.substr(0, this._maxSourceLength);
|
|
102
|
+
this._setData(data);
|
|
103
|
+
this._level = level;
|
|
104
|
+
this._prefix = this._getPrefix();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Allows process log events.
|
|
109
|
+
*/ LogEvent.logManager = new _LogManager.default();
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=./LogEvent.js.map
|