@microsoft/sp-diagnostics 1.23.2 → 1.24.0-beta.3
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 +22 -0
- package/dist/index-internal-public.d.ts +22 -0
- package/dist/index-internal.d.ts +22 -0
- package/dist/sp-diagnostics_none_ebdbca9bc199b51d4466.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 +68 -72
- package/lib-commonjs/DiagnosticsSettingsManager.js +48 -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 → lib-dts}/Diagnostics.d.ts +11 -0
- package/{lib → lib-dts}/DiagnosticsSettingsManager.d.ts +4 -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 +78 -0
- package/lib-esm/DiagnosticsSettingsManager.js +65 -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_414da724f4073ce8bb98.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}/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,143 +0,0 @@
|
|
|
1
|
-
import LogManager from '../LogManager/LogManager';
|
|
2
|
-
import DiagnosticsSettingsManager from '../../DiagnosticsSettingsManager';
|
|
3
|
-
import { setPageExtraData } from '../../extraData/setPageExtraData';
|
|
4
|
-
/**
|
|
5
|
-
* Engagement logging
|
|
6
|
-
* use *.Click for all the actions triggered by mouse, keyboard, or touch.
|
|
7
|
-
* if you want to add more data or the action is not click but keydown.
|
|
8
|
-
* Use extraData to log the type of action or use extraData to log details wrapped in LogEntry
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
var EngagementLogger = /** @class */ (function () {
|
|
12
|
-
function EngagementLogger() {
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Init function for the passed logger object
|
|
16
|
-
*/
|
|
17
|
-
EngagementLogger._addHandler = function (logger) {
|
|
18
|
-
EngagementLogger._handler = function (e) {
|
|
19
|
-
logger.logData(e);
|
|
20
|
-
};
|
|
21
|
-
EngagementLogger._logManager.addHandler(EngagementLogger._handler);
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Starts processing logs in real time
|
|
25
|
-
*/
|
|
26
|
-
EngagementLogger.startRealTimeProcessing = function () {
|
|
27
|
-
if (!this._shouldProcessInRealTime) {
|
|
28
|
-
EngagementLogger._logManager.processAll(EngagementLogger._handler);
|
|
29
|
-
this._shouldProcessInRealTime = true;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Engagement logging
|
|
34
|
-
*
|
|
35
|
-
* @remarks
|
|
36
|
-
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
|
|
37
|
-
* tagName follows `<Workload>.controlName.actionName` pattern
|
|
38
|
-
* For example, `{ name = "AddButton.Click" }`,
|
|
39
|
-
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
|
|
40
|
-
* `<Workload>` is set in Telemetry settings
|
|
41
|
-
* `IEngagementData` interface is mapped to a set of enums for standardization of mapping.
|
|
42
|
-
* Add new items to enum in order to register a new item specification.
|
|
43
|
-
* SiteType is defined in SiteType enum
|
|
44
|
-
* CurrentPage is defined in CurrentPage enum
|
|
45
|
-
* Component is defined in Component enum
|
|
46
|
-
* Feature is defined in Feature enum.
|
|
47
|
-
*/
|
|
48
|
-
EngagementLogger.log = function (engagementData) {
|
|
49
|
-
EngagementLogger._logEngagementData(engagementData);
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Engagement logging
|
|
53
|
-
*
|
|
54
|
-
* @remarks
|
|
55
|
-
* Use *.Click for all the actions triggered by mouse, keyboard, or touch.
|
|
56
|
-
* tagName follows `<Workload>.controlName.actionName` pattern
|
|
57
|
-
* For example, `tagName = "AddButton.Click"`,
|
|
58
|
-
* this logs `"<Workload>.AddButton.Click"` with default action triggered by mouse, keyboard, or touch.
|
|
59
|
-
* `<Workload>` is set in Telemetry settings
|
|
60
|
-
* Use extraData to log the type of action.
|
|
61
|
-
* For example, `actionName = "Keydown"` and `tagName = "ModernPublish.AddButton.Click"`
|
|
62
|
-
* this logs `"<Workload>.AddButton.Click"` with the extraData that it was selected using the Keydown
|
|
63
|
-
*/
|
|
64
|
-
EngagementLogger.logEvent = function (tagName, actionName) {
|
|
65
|
-
var logData = { name: tagName };
|
|
66
|
-
if (actionName && actionName.length !== 0) {
|
|
67
|
-
logData.extraData = { action: actionName };
|
|
68
|
-
}
|
|
69
|
-
EngagementLogger._logEngagementData(logData);
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Engagement logging with LogEntry
|
|
73
|
-
*
|
|
74
|
-
* @remarks
|
|
75
|
-
* Here is an example:
|
|
76
|
-
* ```
|
|
77
|
-
* {"EngagementName":"SPPage.NavigationAction.SPPageQuickLaunchUpdate"`,
|
|
78
|
-
* "Properties":"{\"message\":\"[NavigationAction] | SPPageQuickLaunchUpdate | 2 | null\"}",
|
|
79
|
-
* "Duration":0,"LogType":0,
|
|
80
|
-
* "ClientTime":1459357627444,"Source":"ClientV2Engagement"}
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* NavigationAction is moduleName in LogEntry, SPPageQuickLaunchUpdate is log feature name
|
|
84
|
-
* In this example, SPPage is workload name which is set in Telemetry settings.
|
|
85
|
-
* Do NOT add PII data!
|
|
86
|
-
*/
|
|
87
|
-
EngagementLogger.logEventWithLogEntry = function (logEntry) {
|
|
88
|
-
var logData = {
|
|
89
|
-
isIntentional: logEntry.isIntentional,
|
|
90
|
-
name: logEntry.moduleName + '.' + logEntry.logFeature,
|
|
91
|
-
extraData: logEntry.logProperties
|
|
92
|
-
};
|
|
93
|
-
EngagementLogger._logEngagementData(logData, true);
|
|
94
|
-
};
|
|
95
|
-
EngagementLogger._logEngagementData = function (engagementData, isLogEntry) {
|
|
96
|
-
if (isLogEntry === void 0) { isLogEntry = false; }
|
|
97
|
-
if (!engagementData.name || engagementData.name.length === 0) {
|
|
98
|
-
throw new Error('LogEntry is invalid');
|
|
99
|
-
}
|
|
100
|
-
EngagementLogger._checkValidTagName(engagementData, isLogEntry);
|
|
101
|
-
EngagementLogger._addContextData(engagementData);
|
|
102
|
-
EngagementLogger._appendExtraData(engagementData);
|
|
103
|
-
EngagementLogger._logManager.log(engagementData);
|
|
104
|
-
};
|
|
105
|
-
// tagName should follow AppName.ControlName.ActionName pattern
|
|
106
|
-
EngagementLogger._checkValidTagName = function (engagementData, isLogEntry) {
|
|
107
|
-
if (isLogEntry === void 0) { isLogEntry = false; }
|
|
108
|
-
if (!isLogEntry) {
|
|
109
|
-
var tagNameRegex = /(\w+)\.(\w+).(\w+)/gi;
|
|
110
|
-
if (tagNameRegex.test(engagementData.name) === false) {
|
|
111
|
-
throw new Error("".concat(engagementData.name, " tagName does not follow AppName.ControlName.ActionName pattern"));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
EngagementLogger._addContextData = function (data) {
|
|
116
|
-
if (DiagnosticsSettingsManager.isInitialized) {
|
|
117
|
-
var _a = DiagnosticsSettingsManager.settings, listId = _a.listId, listItemUniqueId = _a.listItemUniqueId, siteId = _a.siteId, webId = _a.webId;
|
|
118
|
-
data.siteId = siteId;
|
|
119
|
-
data.webId = webId;
|
|
120
|
-
if (listId) {
|
|
121
|
-
data.listId = listId;
|
|
122
|
-
if (listItemUniqueId) {
|
|
123
|
-
data.docId = listItemUniqueId;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
EngagementLogger._appendExtraData = function (data) {
|
|
129
|
-
if (DiagnosticsSettingsManager.isInitialized) {
|
|
130
|
-
var contextInfo = DiagnosticsSettingsManager.settings.contextInfo;
|
|
131
|
-
if (contextInfo) {
|
|
132
|
-
if (!data.extraData) {
|
|
133
|
-
data.extraData = {};
|
|
134
|
-
}
|
|
135
|
-
setPageExtraData(contextInfo, data.extraData);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
EngagementLogger._logManager = new LogManager();
|
|
140
|
-
return EngagementLogger;
|
|
141
|
-
}());
|
|
142
|
-
export default EngagementLogger;
|
|
143
|
-
//# sourceMappingURL=EngagementLogger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IEngagementHandler.d.ts","sourceRoot":"","sources":["../../../src/Api/Engagement/IEngagementHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;CACtC;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAE7E,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACnC,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,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allows multiple handlers to be processed in real time or deferred.
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
var ExecutionQueue = /** @class */ (function () {
|
|
6
|
-
function ExecutionQueue() {
|
|
7
|
-
this._shouldExecuteInRealTime = false;
|
|
8
|
-
this._handlers = {};
|
|
9
|
-
this._executionEntries = [];
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(ExecutionQueue.prototype, "shouldExecuteInRealTime", {
|
|
12
|
-
/**
|
|
13
|
-
* Determines if the added execution entries should be processed in real time.
|
|
14
|
-
* If this is set to true, a stack with entries will not be saved.
|
|
15
|
-
*
|
|
16
|
-
* When set to true, all entries on stack will be processed and future entries
|
|
17
|
-
* will be executed in real time.
|
|
18
|
-
* When set to false, future entries will be saved in the execution stack for
|
|
19
|
-
* later processing.
|
|
20
|
-
*/
|
|
21
|
-
get: function () {
|
|
22
|
-
return this._shouldExecuteInRealTime;
|
|
23
|
-
},
|
|
24
|
-
set: function (executeInRealTime) {
|
|
25
|
-
this._shouldExecuteInRealTime = executeInRealTime;
|
|
26
|
-
if (this._shouldExecuteInRealTime) {
|
|
27
|
-
this.flush();
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
enumerable: false,
|
|
31
|
-
configurable: true
|
|
32
|
-
});
|
|
33
|
-
/**
|
|
34
|
-
* Registers an external handler to collection for delayed asynchronous processing.
|
|
35
|
-
* Handlers are registered once. If handler is already registered, it does nothing.
|
|
36
|
-
*/
|
|
37
|
-
ExecutionQueue.prototype.addHandler = function (key, handler) {
|
|
38
|
-
if (this._containsHandler(key, handler)) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
this._initializeHandlerArrayForKey(key);
|
|
42
|
-
var handlers = this._handlers[key];
|
|
43
|
-
if (handlers.indexOf(handler) === -1) {
|
|
44
|
-
handlers.push(handler);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Execution Entry registration for delayed asynchronous processing.
|
|
49
|
-
*/
|
|
50
|
-
ExecutionQueue.prototype.addExecutionEntry = function (key) {
|
|
51
|
-
var args = [];
|
|
52
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
53
|
-
args[_i - 1] = arguments[_i];
|
|
54
|
-
}
|
|
55
|
-
Object.freeze(args);
|
|
56
|
-
if (this._shouldExecuteInRealTime) {
|
|
57
|
-
this._processExecutionEntry(key, args);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
this._executionEntries.push({ key: key, args: args });
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Removes an external executionEntry handler from collection for asynchronous event logging.
|
|
65
|
-
* Logger is registered once.
|
|
66
|
-
*/
|
|
67
|
-
ExecutionQueue.prototype.removeHandler = function (key, handler) {
|
|
68
|
-
var index = this._handlers[key].indexOf(handler);
|
|
69
|
-
if (index > -1) {
|
|
70
|
-
this._handlers[key].splice(index, 1);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Reset function clears executionEntry handler collection for asynchronous event logging.
|
|
75
|
-
* All recorded execution entries and handlers are purged.
|
|
76
|
-
*/
|
|
77
|
-
ExecutionQueue.prototype.reset = function () {
|
|
78
|
-
this._handlers = {};
|
|
79
|
-
this._executionEntries = [];
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Flushes all the buffered execution entries.
|
|
83
|
-
* All recorded execution entries are purged.
|
|
84
|
-
*/
|
|
85
|
-
ExecutionQueue.prototype.flush = function () {
|
|
86
|
-
this._processAllExecutionEntries();
|
|
87
|
-
this._executionEntries = [];
|
|
88
|
-
};
|
|
89
|
-
ExecutionQueue.prototype._containsHandler = function (key, handler) {
|
|
90
|
-
if (this._handlers[key] !== null && this._handlers[key] !== undefined) {
|
|
91
|
-
return this._handlers[key].indexOf(handler) > -1;
|
|
92
|
-
}
|
|
93
|
-
return false;
|
|
94
|
-
};
|
|
95
|
-
ExecutionQueue.prototype._initializeHandlerArrayForKey = function (key) {
|
|
96
|
-
if (this._handlers[key] === null || this._handlers[key] === undefined) {
|
|
97
|
-
this._handlers[key] = [];
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
ExecutionQueue.prototype._processAllExecutionEntries = function () {
|
|
101
|
-
for (var _i = 0, _a = this._executionEntries; _i < _a.length; _i++) {
|
|
102
|
-
var entry = _a[_i];
|
|
103
|
-
if (entry && this._handlers[entry.key]) {
|
|
104
|
-
try {
|
|
105
|
-
for (var _b = 0, _c = this._handlers[entry.key]; _b < _c.length; _b++) {
|
|
106
|
-
var handler = _c[_b];
|
|
107
|
-
handler.apply(this, entry.args);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
// eslint-disable-next-line no-console
|
|
112
|
-
console.error('failed to process execution entry:' + e.toString());
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
ExecutionQueue.prototype._processExecutionEntry = function (key, args) {
|
|
118
|
-
for (var i = 0; i < this._handlers[key].length; i++) {
|
|
119
|
-
try {
|
|
120
|
-
this._handlers[key][i].apply(this, args);
|
|
121
|
-
}
|
|
122
|
-
catch (e) {
|
|
123
|
-
// eslint-disable-next-line no-console
|
|
124
|
-
console.error('failed to process execution entry:' + e.toString());
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
return ExecutionQueue;
|
|
129
|
-
}());
|
|
130
|
-
export default ExecutionQueue;
|
|
131
|
-
//# sourceMappingURL=ExecutionQueue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ILogData.d.ts","sourceRoot":"","sources":["../../src/Api/ILogData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,UAAU,QAAQ;IAChB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAe,QAAQ,CAAC"}
|
package/lib/Api/ILogData.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ILogEntry.d.ts","sourceRoot":"","sources":["../../src/Api/ILogEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC;;GAEG;AACH,UAAU,SAAS;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACpD;AAED,eAAe,SAAS,CAAC"}
|
package/lib/Api/ILogEntry.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ILogErrorData.d.ts","sourceRoot":"","sources":["../../src/Api/ILogErrorData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC;;;;;;;GAOG;AACH,UAAU,aAAc,SAAQ,QAAQ;IACtC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAe,aAAa,CAAC"}
|
package/lib/Api/ILogErrorData.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ILogSource.d.ts","sourceRoot":"","sources":["../../src/Api/ILogSource.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,UAAU,UAAU;IAIlB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAe,UAAU,CAAC"}
|
package/lib/Api/ILogSource.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ILogVerboseData.d.ts","sourceRoot":"","sources":["../../src/Api/ILogVerboseData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC;;GAEG;AACH,UAAU,eAAgB,SAAQ,QAAQ;IACxC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LogHandler.d.ts","sourceRoot":"","sources":["../../../src/Api/Log/LogHandler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI5E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,YAAW,WAAW;IAC7C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAQnE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAOhE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAQhE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;CAOtE"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from '../LogLevel';
|
|
2
|
-
import LogEvent from '../Trace/LogEvent';
|
|
3
|
-
/**
|
|
4
|
-
* This handler adapts the sp-core-library Log to use the internal telemetry.
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
var LogHandler = /** @class */ (function () {
|
|
8
|
-
function LogHandler() {
|
|
9
|
-
}
|
|
10
|
-
LogHandler.prototype.verbose = function (source, message, scope) {
|
|
11
|
-
var event = LogEvent.log(source, message, LogLevel.Verbose, scope);
|
|
12
|
-
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
13
|
-
// eslint-disable-next-line no-console
|
|
14
|
-
console.log(event.toString());
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
LogHandler.prototype.info = function (source, message, scope) {
|
|
18
|
-
var event = LogEvent.log(source, message, LogLevel.Info, scope);
|
|
19
|
-
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
20
|
-
console.info(event.toString());
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
LogHandler.prototype.warn = function (source, message, scope) {
|
|
24
|
-
var event = LogEvent.log(source, message, LogLevel.Warning, scope);
|
|
25
|
-
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
|
-
console.warn(event.toString());
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
LogHandler.prototype.error = function (source, error, scope) {
|
|
31
|
-
var event = LogEvent.log(source, error, LogLevel.Error, scope);
|
|
32
|
-
if (DEBUG && !DEPRECATED_UNIT_TEST) {
|
|
33
|
-
// eslint-disable-next-line no-console
|
|
34
|
-
console.error(event.toString());
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
return LogHandler;
|
|
38
|
-
}());
|
|
39
|
-
export default LogHandler;
|
|
40
|
-
//# sourceMappingURL=LogHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LogEntry.d.ts","sourceRoot":"","sources":["../../src/Api/LogEntry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC;;;;GAIG;AACH,cAAM,QAAS,YAAW,SAAS;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAC9D,aAAa,EAAE,OAAO,GAAG,SAAS,CAAC;IAE1C;;;;;;OAMG;gBAED,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,MAAwB,EACpC,OAAO,GAAE,OAAuB,EAChC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAClD,aAAa,CAAC,EAAE,OAAO;IAazB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAa1B;AAED,eAAe,QAAQ,CAAC"}
|
package/lib/Api/LogEntry.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft. All rights reserved.
|
|
2
|
-
import LogFeature from './LogFeature';
|
|
3
|
-
import LogType from './LogType';
|
|
4
|
-
/**
|
|
5
|
-
* Represents a Log entry
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
var LogEntry = /** @class */ (function () {
|
|
10
|
-
/**
|
|
11
|
-
* Initializes a new instance of LogEntry
|
|
12
|
-
* @param moduleName - the name of the module
|
|
13
|
-
* @param logFeature - the name of the feature
|
|
14
|
-
* @param logType - the log type
|
|
15
|
-
* @param logProperties - optional property bag
|
|
16
|
-
*/
|
|
17
|
-
function LogEntry(moduleName, logFeature, logType, logProperties, isIntentional) {
|
|
18
|
-
if (logFeature === void 0) { logFeature = LogFeature.None; }
|
|
19
|
-
if (logType === void 0) { logType = LogType.Trace; }
|
|
20
|
-
if (moduleName) {
|
|
21
|
-
this.moduleName = moduleName;
|
|
22
|
-
this.logFeature = logFeature;
|
|
23
|
-
this.logType = logType;
|
|
24
|
-
this.logProperties = logProperties;
|
|
25
|
-
this.isIntentional = isIntentional;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
throw new Error('moduleName is invalid');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* convert the log entry to string
|
|
33
|
-
* @returns the serialized log entry
|
|
34
|
-
*/
|
|
35
|
-
LogEntry.prototype.toString = function () {
|
|
36
|
-
var serializedLogProps = undefined;
|
|
37
|
-
if (this.logProperties) {
|
|
38
|
-
try {
|
|
39
|
-
serializedLogProps = JSON.stringify(this.logProperties);
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
// eslint-disable-next-line no-console
|
|
43
|
-
console.log('Error happens in toString():' + e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return "".concat(this.moduleName, " | ").concat(this.logFeature, " | ").concat(this.logType, " | ").concat(serializedLogProps);
|
|
47
|
-
};
|
|
48
|
-
return LogEntry;
|
|
49
|
-
}());
|
|
50
|
-
export default LogEntry;
|
|
51
|
-
//# sourceMappingURL=LogEntry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LogFeature.d.ts","sourceRoot":"","sources":["../../src/Api/LogFeature.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAc,IAAI,EAAE,MAAM,CAAU;CACrC"}
|
package/lib/Api/LogFeature.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LogLevel.d.ts","sourceRoot":"","sources":["../../src/Api/LogLevel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,QAAQ;IAClB;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,OAAO,IAAA;IACP;;OAEG;IACH,KAAK,IAAA;CACN"}
|
package/lib/Api/LogLevel.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LogLevel represents the level of a log event.
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export var LogLevel;
|
|
6
|
-
(function (LogLevel) {
|
|
7
|
-
/**
|
|
8
|
-
* verbose event for debugging
|
|
9
|
-
*/
|
|
10
|
-
LogLevel[LogLevel["Verbose"] = 1] = "Verbose";
|
|
11
|
-
/**
|
|
12
|
-
* Informational event
|
|
13
|
-
*/
|
|
14
|
-
LogLevel[LogLevel["Info"] = 2] = "Info";
|
|
15
|
-
/**
|
|
16
|
-
* A warning
|
|
17
|
-
*/
|
|
18
|
-
LogLevel[LogLevel["Warning"] = 3] = "Warning";
|
|
19
|
-
/**
|
|
20
|
-
* An error
|
|
21
|
-
*/
|
|
22
|
-
LogLevel[LogLevel["Error"] = 4] = "Error";
|
|
23
|
-
})(LogLevel || (LogLevel = {}));
|
|
24
|
-
//# sourceMappingURL=LogLevel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CircularBuffer.d.ts","sourceRoot":"","sources":["../../../src/Api/LogManager/CircularBuffer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,QAAQ;IAC1C;;OAEG;IACH,OAAO,CAAC,KAAK,CAAS;IACtB;;OAEG;IACH,OAAO,CAAC,KAAK,CAAc;IAC3B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,YAAY,CAAkB;gBAEnB,IAAI,EAAE,MAAM;IAQ/B,IAAW,KAAK,IAAI,MAAM,CAEzB;IAEM,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAU1B,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAqBhD,SAAS,IAAI,IAAI;IAMxB;;OAEG;IACH,OAAO,KAAK,KAAK,GAKhB;IAED,OAAO,CAAC,aAAa;IAIrB;;;OAGG;IACH,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,mBAAmB;CAK5B"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
var CircularBuffer = /** @class */ (function () {
|
|
5
|
-
function CircularBuffer(size) {
|
|
6
|
-
/**
|
|
7
|
-
* Index of the newest item in the buffer
|
|
8
|
-
*/
|
|
9
|
-
this._head = -1;
|
|
10
|
-
/**
|
|
11
|
-
* The overall count of how many items have ever been added to the buffer.
|
|
12
|
-
*/
|
|
13
|
-
this._count = 0;
|
|
14
|
-
this._isIterating = false;
|
|
15
|
-
if (size <= 0) {
|
|
16
|
-
throw new Error('Size must be positive');
|
|
17
|
-
}
|
|
18
|
-
this._size = size;
|
|
19
|
-
this._buffer = new Array(size);
|
|
20
|
-
}
|
|
21
|
-
Object.defineProperty(CircularBuffer.prototype, "count", {
|
|
22
|
-
get: function () {
|
|
23
|
-
return this._count;
|
|
24
|
-
},
|
|
25
|
-
enumerable: false,
|
|
26
|
-
configurable: true
|
|
27
|
-
});
|
|
28
|
-
CircularBuffer.prototype.push = function (item) {
|
|
29
|
-
this._ensureNotIterating();
|
|
30
|
-
this._head++;
|
|
31
|
-
this._count++;
|
|
32
|
-
if (this._head === this._size) {
|
|
33
|
-
this._head = 0;
|
|
34
|
-
}
|
|
35
|
-
this._buffer[this._head] = item;
|
|
36
|
-
};
|
|
37
|
-
CircularBuffer.prototype.forEach = function (handle) {
|
|
38
|
-
if (this._count === 0) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
this._isIterating = true;
|
|
42
|
-
try {
|
|
43
|
-
var current = this._tail;
|
|
44
|
-
// For-loop is prefered over while loop here to avoid possible infinite loop.
|
|
45
|
-
for (var i = 0; i < this._size; i++) {
|
|
46
|
-
handle(this._buffer[current]);
|
|
47
|
-
if (current === this._head) {
|
|
48
|
-
// The newest item has been processed. End the loop.
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
current = this._getNext(current);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
finally {
|
|
55
|
-
this._isIterating = false;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
CircularBuffer.prototype.removeAll = function () {
|
|
59
|
-
this._ensureNotIterating();
|
|
60
|
-
this._head = -1;
|
|
61
|
-
this._count = 0;
|
|
62
|
-
};
|
|
63
|
-
Object.defineProperty(CircularBuffer.prototype, "_tail", {
|
|
64
|
-
/**
|
|
65
|
-
* Index of the oldest item in the buffer
|
|
66
|
-
*/
|
|
67
|
-
get: function () {
|
|
68
|
-
if (this._isNotWrapped()) {
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
return this._getNext(this._head);
|
|
72
|
-
},
|
|
73
|
-
enumerable: false,
|
|
74
|
-
configurable: true
|
|
75
|
-
});
|
|
76
|
-
CircularBuffer.prototype._isNotWrapped = function () {
|
|
77
|
-
return this._count === this._head + 1;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* The next index should be index + 1, unless it reaches
|
|
81
|
-
* the end of the buffer and needs to rewind to 0.
|
|
82
|
-
*/
|
|
83
|
-
CircularBuffer.prototype._getNext = function (index) {
|
|
84
|
-
var nextIndex = index + 1;
|
|
85
|
-
if (nextIndex === this._size) {
|
|
86
|
-
nextIndex = 0;
|
|
87
|
-
}
|
|
88
|
-
return nextIndex;
|
|
89
|
-
};
|
|
90
|
-
CircularBuffer.prototype._ensureNotIterating = function () {
|
|
91
|
-
if (this._isIterating) {
|
|
92
|
-
throw new Error('Circular buffer cannot be modified during iteration');
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
return CircularBuffer;
|
|
96
|
-
}());
|
|
97
|
-
export default CircularBuffer;
|
|
98
|
-
//# sourceMappingURL=CircularBuffer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LogManager.d.ts","sourceRoot":"","sources":["../../../src/Api/LogManager/LogManager.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,IAAI;IAClC,OAAO,CAAC,MAAM,KAAK,cAAc,GAEhC;IACD,OAAO,CAAC,oBAAoB,CAAsB;IAClD,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,OAAO,CAA6E;gBAEzE,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI;IAMrD;;;OAGG;IACH,IAAW,MAAM,IAAI,cAAc,CAAC,IAAI,CAAC,CAExC;IAED;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAOnD;;OAEG;IACI,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI;IAO7B;;;OAGG;IACI,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAQtD;;;OAGG;IACI,KAAK,IAAI,IAAI;IAMpB;;OAEG;IACI,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAMnD,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,gBAAgB;CAYzB"}
|