@certinia/apex-log-mcp 1.0.0
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/LICENSE.txt +28 -0
- package/README.md +216 -0
- package/dist/ApexLogParser.js +2788 -0
- package/dist/index.js +77 -0
- package/dist/salesforce/connection.js +15 -0
- package/dist/salesforce/debugLevels.js +125 -0
- package/dist/salesforce/traceFlags.js +43 -0
- package/dist/salesforce/users.js +13 -0
- package/dist/tools/analyzeLogPerformance.js +150 -0
- package/dist/tools/executeAnonymous.js +182 -0
- package/dist/tools/findPerformanceBottlenecks.js +165 -0
- package/dist/tools/getLogSummary.js +88 -0
- package/package.json +73 -0
|
@@ -0,0 +1,2788 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 Certinia Inc. All rights reserved.
|
|
3
|
+
* This is a copy of the ApexLogParser from the Lana project. In the future this will be moved to
|
|
4
|
+
* its own package and imported.
|
|
5
|
+
*/
|
|
6
|
+
const typePattern = /^[A-Z_]*$/, settingsPattern = /^\d+\.\d+\sAPEX_CODE,\w+;APEX_PROFILING,.+$/m;
|
|
7
|
+
/**
|
|
8
|
+
* Takes string input of a log and returns the ApexLog class, which represents a log tree
|
|
9
|
+
* @param {string} logData
|
|
10
|
+
* @returns {ApexLog}
|
|
11
|
+
*/
|
|
12
|
+
export function parse(logData) {
|
|
13
|
+
return new ApexLogParser().parse(logData);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* An Apex Log file can be parsed by passing the text.
|
|
17
|
+
* You can either import the ApexLogParser class or import the parse method e.g.
|
|
18
|
+
*
|
|
19
|
+
* import ApexLogParser, { parse } from ./ApexLogParser.js
|
|
20
|
+
* const apexLog = new ApexLogParser().parse(logText);
|
|
21
|
+
* const apexLog = parse(logText);
|
|
22
|
+
*/
|
|
23
|
+
export class ApexLogParser {
|
|
24
|
+
logIssues = [];
|
|
25
|
+
parsingErrors = [];
|
|
26
|
+
maxSizeTimestamp = null;
|
|
27
|
+
reasons = new Set();
|
|
28
|
+
lastTimestamp = 0;
|
|
29
|
+
discontinuity = false;
|
|
30
|
+
namespaces = new Set();
|
|
31
|
+
governorLimits = {
|
|
32
|
+
soqlQueries: { used: 0, limit: 0 },
|
|
33
|
+
soslQueries: { used: 0, limit: 0 },
|
|
34
|
+
queryRows: { used: 0, limit: 0 },
|
|
35
|
+
dmlStatements: { used: 0, limit: 0 },
|
|
36
|
+
publishImmediateDml: { used: 0, limit: 0 },
|
|
37
|
+
dmlRows: { used: 0, limit: 0 },
|
|
38
|
+
cpuTime: { used: 0, limit: 0 },
|
|
39
|
+
heapSize: { used: 0, limit: 0 },
|
|
40
|
+
callouts: { used: 0, limit: 0 },
|
|
41
|
+
emailInvocations: { used: 0, limit: 0 },
|
|
42
|
+
futureCalls: { used: 0, limit: 0 },
|
|
43
|
+
queueableJobsAddedToQueue: { used: 0, limit: 0 },
|
|
44
|
+
mobileApexPushCalls: { used: 0, limit: 0 },
|
|
45
|
+
byNamespace: new Map(),
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Takes string input of a log and returns the ApexLog class, which represents a log tree
|
|
49
|
+
* @param {string} debugLog
|
|
50
|
+
* @returns {ApexLog}
|
|
51
|
+
*/
|
|
52
|
+
parse(debugLog) {
|
|
53
|
+
const lineGenerator = this.generateLogLines(debugLog);
|
|
54
|
+
const apexLog = this.toLogTree(lineGenerator);
|
|
55
|
+
apexLog.size = debugLog.length;
|
|
56
|
+
apexLog.debugLevels = this.getDebugLevels(debugLog);
|
|
57
|
+
apexLog.logIssues = this.logIssues;
|
|
58
|
+
apexLog.parsingErrors = this.parsingErrors;
|
|
59
|
+
apexLog.namespaces = Array.from(this.namespaces);
|
|
60
|
+
apexLog.governorLimits = this.governorLimits;
|
|
61
|
+
this.addGovernorLimits(apexLog);
|
|
62
|
+
return apexLog;
|
|
63
|
+
}
|
|
64
|
+
addGovernorLimits(apexLog) {
|
|
65
|
+
const totalLimits = apexLog.governorLimits;
|
|
66
|
+
if (totalLimits) {
|
|
67
|
+
for (const limitsForNs of apexLog.governorLimits.byNamespace.values()) {
|
|
68
|
+
for (const [key, value] of Object.entries(limitsForNs)) {
|
|
69
|
+
if (!value) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const currentLimit = totalLimits[key];
|
|
73
|
+
currentLimit.limit = value.limit;
|
|
74
|
+
currentLimit.used += value.used;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
parseLine(line, lastEntry) {
|
|
80
|
+
const parts = line.split("|");
|
|
81
|
+
const type = parts[1] ?? "";
|
|
82
|
+
const metaCtor = getLogEventClass(type);
|
|
83
|
+
if (metaCtor) {
|
|
84
|
+
const entry = new metaCtor(this, parts);
|
|
85
|
+
entry.logLine = line;
|
|
86
|
+
lastEntry?.onAfter?.(this, entry);
|
|
87
|
+
if (entry.namespace) {
|
|
88
|
+
this.namespaces.add(entry.namespace);
|
|
89
|
+
}
|
|
90
|
+
return entry;
|
|
91
|
+
}
|
|
92
|
+
const hasType = !!(type && typePattern.test(type));
|
|
93
|
+
if (!hasType && lastEntry?.acceptsText) {
|
|
94
|
+
// wrapped text from the previous entry?
|
|
95
|
+
lastEntry.text += "\n" + line;
|
|
96
|
+
}
|
|
97
|
+
else if (hasType) {
|
|
98
|
+
const message = `Unsupported log event name: ${type}`;
|
|
99
|
+
if (!this.parsingErrors.includes(message)) {
|
|
100
|
+
this.parsingErrors.push(message);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (lastEntry && line.startsWith("*** Skipped")) {
|
|
104
|
+
this.addLogIssue(lastEntry.timestamp, "Skipped-Lines", `${line}. A section of the log has been skipped and the log has been truncated. Full details of this section of log can not be provided.`, "skip");
|
|
105
|
+
}
|
|
106
|
+
else if (lastEntry &&
|
|
107
|
+
line.indexOf("MAXIMUM DEBUG LOG SIZE REACHED") !== -1) {
|
|
108
|
+
this.addLogIssue(lastEntry.timestamp, "Max-Size-reached", "The maximum log size has been reached. Part of the log has been truncated.", "skip");
|
|
109
|
+
this.maxSizeTimestamp = lastEntry.timestamp;
|
|
110
|
+
}
|
|
111
|
+
else if (!hasType && settingsPattern.test(line)) {
|
|
112
|
+
// skip an unexpected settings line
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
this.parsingErrors.push(`Invalid log line: ${line}`);
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
*generateLogLines(log) {
|
|
120
|
+
const start = log.search(/^\d{2}:\d{2}:\d{2}.\d{1} \(\d+\)\|EXECUTION_STARTED$/m);
|
|
121
|
+
if (start > -1) {
|
|
122
|
+
log = log.slice(start);
|
|
123
|
+
}
|
|
124
|
+
const hascrlf = log.indexOf("\r\n") > -1;
|
|
125
|
+
let lastEntry = null;
|
|
126
|
+
let lfIndex = log.indexOf("\n");
|
|
127
|
+
let eolIndex = lfIndex;
|
|
128
|
+
let startIndex = 0;
|
|
129
|
+
let crlfIndex = -1;
|
|
130
|
+
while (eolIndex !== -1) {
|
|
131
|
+
if (hascrlf && eolIndex > crlfIndex) {
|
|
132
|
+
crlfIndex = log.indexOf("\r", eolIndex - 1);
|
|
133
|
+
eolIndex = crlfIndex + 1 === eolIndex ? crlfIndex : lfIndex;
|
|
134
|
+
}
|
|
135
|
+
const line = log.slice(startIndex, eolIndex);
|
|
136
|
+
if (line) {
|
|
137
|
+
// ignore blank lines
|
|
138
|
+
const entry = this.parseLine(line, lastEntry);
|
|
139
|
+
if (entry) {
|
|
140
|
+
lastEntry = entry;
|
|
141
|
+
yield entry;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
startIndex = lfIndex + 1;
|
|
145
|
+
lfIndex = eolIndex = log.indexOf("\n", startIndex);
|
|
146
|
+
}
|
|
147
|
+
// Parse the last line
|
|
148
|
+
const line = log.slice(startIndex, log.length);
|
|
149
|
+
if (line) {
|
|
150
|
+
// ignore blank lines
|
|
151
|
+
const entry = this.parseLine(line, lastEntry);
|
|
152
|
+
if (entry) {
|
|
153
|
+
entry?.onAfter?.(this);
|
|
154
|
+
yield entry;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
toLogTree(lineGenerator) {
|
|
159
|
+
const rootMethod = new ApexLog(this), stack = [];
|
|
160
|
+
let line;
|
|
161
|
+
const lineIter = new LineIterator(lineGenerator);
|
|
162
|
+
while ((line = lineIter.fetch())) {
|
|
163
|
+
if (line instanceof Method) {
|
|
164
|
+
this.parseTree(line, lineIter, stack);
|
|
165
|
+
}
|
|
166
|
+
line.parent = rootMethod;
|
|
167
|
+
rootMethod.addChild(line);
|
|
168
|
+
}
|
|
169
|
+
rootMethod.setTimes();
|
|
170
|
+
this.insertPackageWrappers(rootMethod);
|
|
171
|
+
this.aggregateTotals([rootMethod]);
|
|
172
|
+
return rootMethod;
|
|
173
|
+
}
|
|
174
|
+
parseTree(currentLine, lineIter, stack) {
|
|
175
|
+
this.lastTimestamp = currentLine.timestamp;
|
|
176
|
+
currentLine.namespace ||= "default";
|
|
177
|
+
const isEntry = currentLine.exitTypes.length;
|
|
178
|
+
if (isEntry) {
|
|
179
|
+
const exitOnNextLine = currentLine.nextLineIsExit;
|
|
180
|
+
let nextLine;
|
|
181
|
+
stack.push(currentLine);
|
|
182
|
+
while ((nextLine = lineIter.peek())) {
|
|
183
|
+
// discontinuities are stack unwinding (caused by Exceptions)
|
|
184
|
+
this.discontinuity ||= nextLine.discontinuity; // start unwinding stack
|
|
185
|
+
// Exit Line has been found no more work needed
|
|
186
|
+
if (!exitOnNextLine &&
|
|
187
|
+
!nextLine.nextLineIsExit &&
|
|
188
|
+
nextLine.isExit &&
|
|
189
|
+
!nextLine.exitTypes.length &&
|
|
190
|
+
this.endMethod(currentLine, nextLine, lineIter, stack)) {
|
|
191
|
+
// the method wants to see the exit line
|
|
192
|
+
currentLine.onEnd?.(nextLine, stack);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
else if (exitOnNextLine &&
|
|
196
|
+
(nextLine.nextLineIsExit ||
|
|
197
|
+
nextLine.isExit ||
|
|
198
|
+
nextLine.exitTypes.length > 0)) {
|
|
199
|
+
currentLine.exitStamp = nextLine.timestamp;
|
|
200
|
+
currentLine.onEnd?.(nextLine, stack);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
else if (this.discontinuity &&
|
|
204
|
+
this.maxSizeTimestamp &&
|
|
205
|
+
nextLine.timestamp > this.maxSizeTimestamp) {
|
|
206
|
+
// The current line was truncated (we did not find the exit line before the end of log) and there was a discontinuity
|
|
207
|
+
currentLine.isTruncated = true;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
lineIter.fetch(); // it's a child - consume the line
|
|
211
|
+
this.lastTimestamp = nextLine.timestamp;
|
|
212
|
+
nextLine.namespace ||= currentLine.namespace || "default";
|
|
213
|
+
nextLine.parent = currentLine;
|
|
214
|
+
currentLine.children.push(nextLine);
|
|
215
|
+
if (nextLine instanceof Method) {
|
|
216
|
+
this.parseTree(nextLine, lineIter, stack);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// End of line error handling. We have finished processing this log line and either got to the end
|
|
220
|
+
// of the log without finding an exit line or the current line was truncated)
|
|
221
|
+
if (!nextLine || currentLine.isTruncated) {
|
|
222
|
+
// truncated method - terminate at the end of the log
|
|
223
|
+
currentLine.exitStamp = this.lastTimestamp ?? currentLine.timestamp;
|
|
224
|
+
// we found an entry event on its own e.g a `METHOD_ENTRY` without a `METHOD_EXIT` and got to the end of the log
|
|
225
|
+
this.addLogIssue(currentLine.exitStamp, "Unexpected-End", "An entry event was found without a corresponding exit event e.g a `METHOD_ENTRY` event without a `METHOD_EXIT`", "unexpected");
|
|
226
|
+
if (currentLine.isTruncated) {
|
|
227
|
+
this.updateLogIssue(currentLine.exitStamp, "Max-Size-reached", "The maximum log size has been reached. Part of the log has been truncated.", "skip");
|
|
228
|
+
this.maxSizeTimestamp = currentLine.exitStamp;
|
|
229
|
+
}
|
|
230
|
+
currentLine.isTruncated = true;
|
|
231
|
+
}
|
|
232
|
+
stack.pop();
|
|
233
|
+
currentLine.recalculateDurations();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
isMatchingEnd(startMethod, endLine) {
|
|
237
|
+
return !!(endLine.type &&
|
|
238
|
+
startMethod.exitTypes.includes(endLine.type) &&
|
|
239
|
+
(endLine.lineNumber === startMethod.lineNumber ||
|
|
240
|
+
!endLine.lineNumber ||
|
|
241
|
+
!startMethod.lineNumber));
|
|
242
|
+
}
|
|
243
|
+
endMethod(startMethod, endLine, lineIter, stack) {
|
|
244
|
+
startMethod.exitStamp = endLine.timestamp;
|
|
245
|
+
// is this a 'good' end line?
|
|
246
|
+
if (this.isMatchingEnd(startMethod, endLine)) {
|
|
247
|
+
this.discontinuity = false; // end stack unwinding
|
|
248
|
+
lineIter.fetch(); // consume the line
|
|
249
|
+
return true; // success
|
|
250
|
+
}
|
|
251
|
+
else if (this.discontinuity) {
|
|
252
|
+
return true; // exception - unwind
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
if (stack.some((m) => this.isMatchingEnd(m, endLine))) {
|
|
256
|
+
return true; // we match a method further down the stack - unwind
|
|
257
|
+
}
|
|
258
|
+
// we found an exit event on its own e.g a `METHOD_EXIT` without a `METHOD_ENTRY`
|
|
259
|
+
this.addLogIssue(endLine.timestamp, "Unexpected-Exit", "An exit event was found without a corresponding entry event e.g a `METHOD_EXIT` event without a `METHOD_ENTRY`", "unexpected");
|
|
260
|
+
return false; // we have no matching method - ignore
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
flattenByDepth(nodes) {
|
|
264
|
+
const result = new Map();
|
|
265
|
+
let currentDepth = 0;
|
|
266
|
+
let currentNodes = nodes;
|
|
267
|
+
let len = currentNodes.length;
|
|
268
|
+
while (len) {
|
|
269
|
+
result.set(currentDepth, currentNodes);
|
|
270
|
+
const children = [];
|
|
271
|
+
while (len--) {
|
|
272
|
+
const node = currentNodes[len];
|
|
273
|
+
if (node?.children) {
|
|
274
|
+
node.children.forEach((c) => {
|
|
275
|
+
if (c.children.length) {
|
|
276
|
+
children.push(c);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
currentDepth++;
|
|
282
|
+
currentNodes = children;
|
|
283
|
+
len = currentNodes.length;
|
|
284
|
+
}
|
|
285
|
+
return result;
|
|
286
|
+
}
|
|
287
|
+
aggregateTotals(nodes) {
|
|
288
|
+
const len = nodes.length;
|
|
289
|
+
if (!len) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
// This method purposely processes the children at the lowest depth first in bulk to avoid as much recursion as possible. This increases performance to be just over ~3 times faster or ~70% faster.
|
|
293
|
+
// collect all children for the supplied nodes by depth.
|
|
294
|
+
const nodesByDepth = this.flattenByDepth(nodes);
|
|
295
|
+
let depth = nodesByDepth.size;
|
|
296
|
+
while (depth--) {
|
|
297
|
+
const nds = nodesByDepth.get(depth) ?? [];
|
|
298
|
+
let i = nds.length;
|
|
299
|
+
while (i--) {
|
|
300
|
+
const parent = nds[i];
|
|
301
|
+
parent?.children.forEach((child) => {
|
|
302
|
+
parent.dmlCount.total += child.dmlCount.total;
|
|
303
|
+
parent.soqlCount.total += child.soqlCount.total;
|
|
304
|
+
parent.soslCount.total += child.soslCount.total;
|
|
305
|
+
parent.dmlRowCount.total += child.dmlRowCount.total;
|
|
306
|
+
parent.soqlRowCount.total += child.soqlRowCount.total;
|
|
307
|
+
parent.soslRowCount.total += child.soslRowCount.total;
|
|
308
|
+
parent.duration.self -= child.duration.total;
|
|
309
|
+
parent.totalThrownCount += child.totalThrownCount;
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
nodesByDepth.delete(depth);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
insertPackageWrappers(node) {
|
|
316
|
+
const children = node.children;
|
|
317
|
+
let lastPkg = null;
|
|
318
|
+
const newChildren = [];
|
|
319
|
+
const len = children.length;
|
|
320
|
+
for (let i = 0; i < len; i++) {
|
|
321
|
+
const child = children[i];
|
|
322
|
+
if (child) {
|
|
323
|
+
const isPkgType = child.type === "ENTERING_MANAGED_PKG";
|
|
324
|
+
if (lastPkg && child instanceof TimedNode) {
|
|
325
|
+
if (isPkgType && child.namespace === lastPkg.namespace) {
|
|
326
|
+
// combine adjacent (like) packages
|
|
327
|
+
lastPkg.exitStamp = child.exitStamp || child.timestamp;
|
|
328
|
+
continue; // skip any more child processing (it's gone)
|
|
329
|
+
}
|
|
330
|
+
else if (!isPkgType) {
|
|
331
|
+
// we are done merging adjacent `ENTERING_MANAGED_PKG` of the same namesapce
|
|
332
|
+
lastPkg.recalculateDurations();
|
|
333
|
+
lastPkg = null;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (child instanceof Method) {
|
|
337
|
+
this.insertPackageWrappers(child);
|
|
338
|
+
}
|
|
339
|
+
// It is a ENTERING_MANAGED_PKG line that does not match the last one
|
|
340
|
+
// or we have not come across a ENTERING_MANAGED_PKG line yet.
|
|
341
|
+
if (isPkgType) {
|
|
342
|
+
lastPkg?.recalculateDurations();
|
|
343
|
+
lastPkg = child;
|
|
344
|
+
}
|
|
345
|
+
newChildren.push(child);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
lastPkg?.recalculateDurations();
|
|
349
|
+
node.children = newChildren;
|
|
350
|
+
}
|
|
351
|
+
addLogIssue(startTime, summary, description, type) {
|
|
352
|
+
if (!this.reasons.has(summary)) {
|
|
353
|
+
this.reasons.add(summary);
|
|
354
|
+
this.logIssues.push({
|
|
355
|
+
startTime: startTime,
|
|
356
|
+
summary: summary,
|
|
357
|
+
description: description,
|
|
358
|
+
type: type,
|
|
359
|
+
});
|
|
360
|
+
this.logIssues.sort((a, b) => (a.startTime || 0) - (b.startTime || 0));
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
updateLogIssue(startTime, summary, description, type) {
|
|
364
|
+
const elem = this.logIssues.findIndex((item) => {
|
|
365
|
+
return item.summary === summary;
|
|
366
|
+
});
|
|
367
|
+
if (elem > -1) {
|
|
368
|
+
this.logIssues.splice(elem, 1);
|
|
369
|
+
}
|
|
370
|
+
this.reasons.delete(summary);
|
|
371
|
+
this.addLogIssue(startTime, summary, description, type);
|
|
372
|
+
}
|
|
373
|
+
getDebugLevels(log) {
|
|
374
|
+
const match = log.match(settingsPattern);
|
|
375
|
+
if (!match) {
|
|
376
|
+
return [];
|
|
377
|
+
}
|
|
378
|
+
const settings = match[0], settingList = settings.substring(settings.indexOf(" ") + 1).split(";");
|
|
379
|
+
return settingList.map((entry) => {
|
|
380
|
+
const parts = entry.split(",");
|
|
381
|
+
return new DebugLevel(parts[0] || "", parts[1] || "");
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
export class DebugLevel {
|
|
386
|
+
logCategory;
|
|
387
|
+
logLevel;
|
|
388
|
+
constructor(category, level) {
|
|
389
|
+
this.logCategory = category;
|
|
390
|
+
this.logLevel = level;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
export class LineIterator {
|
|
394
|
+
next;
|
|
395
|
+
lineGenerator;
|
|
396
|
+
constructor(lineGenerator) {
|
|
397
|
+
this.lineGenerator = lineGenerator;
|
|
398
|
+
this.next = this.lineGenerator.next().value;
|
|
399
|
+
}
|
|
400
|
+
peek() {
|
|
401
|
+
return this.next;
|
|
402
|
+
}
|
|
403
|
+
fetch() {
|
|
404
|
+
const result = this.next;
|
|
405
|
+
this.next = this.lineGenerator.next().value;
|
|
406
|
+
return result;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* All log lines extend this base class.
|
|
411
|
+
*/
|
|
412
|
+
export class LogLine {
|
|
413
|
+
logParser;
|
|
414
|
+
// common metadata (available for all lines)
|
|
415
|
+
parent = null;
|
|
416
|
+
/**
|
|
417
|
+
* All child nodes of the current node
|
|
418
|
+
*/
|
|
419
|
+
children = [];
|
|
420
|
+
/**
|
|
421
|
+
* The type of this log line from the log file e.g METHOD_ENTRY
|
|
422
|
+
*/
|
|
423
|
+
type = null;
|
|
424
|
+
/**
|
|
425
|
+
* The full raw text of this log line
|
|
426
|
+
*/
|
|
427
|
+
logLine = ""; // the raw text of this log line
|
|
428
|
+
/**
|
|
429
|
+
* A parsed version of the log line text useful for display in UIs
|
|
430
|
+
*/
|
|
431
|
+
text;
|
|
432
|
+
// optional metadata
|
|
433
|
+
/**
|
|
434
|
+
* Should this log entry pull in following text lines (as the log entry can contain newlines)?
|
|
435
|
+
*/
|
|
436
|
+
acceptsText = false;
|
|
437
|
+
/**
|
|
438
|
+
* Is this log entry generated by a declarative process?
|
|
439
|
+
*/
|
|
440
|
+
declarative = false;
|
|
441
|
+
/**
|
|
442
|
+
* Is a method exit line?
|
|
443
|
+
*/
|
|
444
|
+
isExit = false;
|
|
445
|
+
/**
|
|
446
|
+
* Should the exitstamp be the timestamp of the next line?
|
|
447
|
+
* These kind of lines can not be used as exit lines for anything othe than other pseudo exits.
|
|
448
|
+
*/
|
|
449
|
+
nextLineIsExit = false;
|
|
450
|
+
/**
|
|
451
|
+
* The line number within the containing class
|
|
452
|
+
*/
|
|
453
|
+
lineNumber = null;
|
|
454
|
+
/**
|
|
455
|
+
* The package namespace associated with this log line
|
|
456
|
+
* @default default
|
|
457
|
+
*/
|
|
458
|
+
namespace = "";
|
|
459
|
+
/**
|
|
460
|
+
* The variable value
|
|
461
|
+
*/
|
|
462
|
+
value = null;
|
|
463
|
+
/**
|
|
464
|
+
* Could match to a corresponding symbol in a file in the workspace?
|
|
465
|
+
*/
|
|
466
|
+
hasValidSymbols = false;
|
|
467
|
+
/**
|
|
468
|
+
* Extra description context
|
|
469
|
+
*/
|
|
470
|
+
suffix = null;
|
|
471
|
+
/**
|
|
472
|
+
* Does this line cause a discontinuity in the call stack? e.g an exception causing stack unwinding
|
|
473
|
+
*/
|
|
474
|
+
discontinuity = false;
|
|
475
|
+
/**
|
|
476
|
+
* The timestamp of this log line, in nanoseconds
|
|
477
|
+
*/
|
|
478
|
+
timestamp;
|
|
479
|
+
/**
|
|
480
|
+
* The time spent.
|
|
481
|
+
*/
|
|
482
|
+
duration = {
|
|
483
|
+
/**
|
|
484
|
+
* The net (wall) time spent in the node (when not inside children)
|
|
485
|
+
*/
|
|
486
|
+
self: 0,
|
|
487
|
+
/**
|
|
488
|
+
* The total (wall) time spent in the node
|
|
489
|
+
*/
|
|
490
|
+
total: 0,
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* Total + self row counts for DML
|
|
494
|
+
*/
|
|
495
|
+
dmlRowCount = {
|
|
496
|
+
/**
|
|
497
|
+
* The net number of DML rows for this node, excluding child nodes
|
|
498
|
+
*/
|
|
499
|
+
self: 0,
|
|
500
|
+
/**
|
|
501
|
+
* The total number of DML rows for this node and child nodes
|
|
502
|
+
*/
|
|
503
|
+
total: 0,
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Total + self row counts for SOQL
|
|
507
|
+
*/
|
|
508
|
+
soqlRowCount = {
|
|
509
|
+
/**
|
|
510
|
+
* The net number of SOQL rows for this node, excluding child nodes
|
|
511
|
+
*/
|
|
512
|
+
self: 0,
|
|
513
|
+
/**
|
|
514
|
+
* The total number of SOQL rows for this node and child nodes
|
|
515
|
+
*/
|
|
516
|
+
total: 0,
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* Total + self row counts for SOSL
|
|
520
|
+
*/
|
|
521
|
+
soslRowCount = {
|
|
522
|
+
/**
|
|
523
|
+
* The net number of SOSL rows for this node, excluding child nodes
|
|
524
|
+
*/
|
|
525
|
+
self: 0,
|
|
526
|
+
/**
|
|
527
|
+
* The total number of SOSL rows for this node and child nodes
|
|
528
|
+
*/
|
|
529
|
+
total: 0,
|
|
530
|
+
};
|
|
531
|
+
dmlCount = {
|
|
532
|
+
/**
|
|
533
|
+
* The net number of DML operations (DML_BEGIN) in this node.
|
|
534
|
+
*/
|
|
535
|
+
self: 0,
|
|
536
|
+
/**
|
|
537
|
+
* The total number of DML operations (DML_BEGIN) in this node and child nodes
|
|
538
|
+
*/
|
|
539
|
+
total: 0,
|
|
540
|
+
};
|
|
541
|
+
soqlCount = {
|
|
542
|
+
/**
|
|
543
|
+
* The net number of SOQL operations (SOQL_EXECUTE_BEGIN) in this node.
|
|
544
|
+
*/
|
|
545
|
+
self: 0,
|
|
546
|
+
/**
|
|
547
|
+
* The total number of SOQL operations (SOQL_EXECUTE_BEGIN) in this node and child nodes
|
|
548
|
+
*/
|
|
549
|
+
total: 0,
|
|
550
|
+
};
|
|
551
|
+
soslCount = {
|
|
552
|
+
/**
|
|
553
|
+
* The net number of SOSL operations (SOSL_EXECUTE_BEGIN) in this node.
|
|
554
|
+
*/
|
|
555
|
+
self: 0,
|
|
556
|
+
/**
|
|
557
|
+
* The total number of SOSL operations (SOSL_EXECUTE_BEGIN) in this node and child nodes
|
|
558
|
+
*/
|
|
559
|
+
total: 0,
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* The total number of exceptions thrown (EXCEPTION_THROWN) in this node and child nodes
|
|
563
|
+
*/
|
|
564
|
+
totalThrownCount = 0;
|
|
565
|
+
/**
|
|
566
|
+
* The line types which would legitimately end this method
|
|
567
|
+
*/
|
|
568
|
+
exitTypes = [];
|
|
569
|
+
constructor(parser, parts) {
|
|
570
|
+
this.logParser = parser;
|
|
571
|
+
if (parts) {
|
|
572
|
+
const [timeData, type] = parts;
|
|
573
|
+
this.text = this.type = type;
|
|
574
|
+
this.timestamp = timeData ? this.parseTimestamp(timeData) : 0;
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
this.timestamp = 0;
|
|
578
|
+
this.text = "";
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
parseTimestamp(text) {
|
|
582
|
+
const start = text.indexOf("(");
|
|
583
|
+
if (start !== -1) {
|
|
584
|
+
return Number(text.slice(start + 1, -1));
|
|
585
|
+
}
|
|
586
|
+
throw new Error(`Unable to parse timestamp: '${text}'`);
|
|
587
|
+
}
|
|
588
|
+
parseLineNumber(text) {
|
|
589
|
+
switch (true) {
|
|
590
|
+
case text === "[EXTERNAL]":
|
|
591
|
+
return "EXTERNAL";
|
|
592
|
+
case !!text: {
|
|
593
|
+
const lineNumberStr = text.slice(1, -1);
|
|
594
|
+
if (lineNumberStr) {
|
|
595
|
+
return Number(lineNumberStr);
|
|
596
|
+
}
|
|
597
|
+
throw new Error(`Unable to parse line number: '${text}'`);
|
|
598
|
+
}
|
|
599
|
+
default:
|
|
600
|
+
return 0;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
class BasicLogLine extends LogLine {
|
|
605
|
+
}
|
|
606
|
+
class BasicExitLine extends LogLine {
|
|
607
|
+
isExit = true;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Log lines extend this class if they have a duration (and hence can be shown on the timeline).
|
|
611
|
+
* There are no real children (as there is no exit line), but children can get reparented here...
|
|
612
|
+
*/
|
|
613
|
+
export class TimedNode extends LogLine {
|
|
614
|
+
/**
|
|
615
|
+
* The timestamp when the node finished, in nanoseconds
|
|
616
|
+
*/
|
|
617
|
+
exitStamp = null;
|
|
618
|
+
/**
|
|
619
|
+
* The log sub category this event belongs to
|
|
620
|
+
*/
|
|
621
|
+
subCategory;
|
|
622
|
+
/**
|
|
623
|
+
* The CPU type, e.g loading, method, custom
|
|
624
|
+
*/
|
|
625
|
+
cpuType; // the category key to collect our cpu usage
|
|
626
|
+
constructor(parser, parts, timelineKey, cpuType) {
|
|
627
|
+
super(parser, parts);
|
|
628
|
+
this.subCategory = timelineKey;
|
|
629
|
+
this.cpuType = cpuType;
|
|
630
|
+
}
|
|
631
|
+
addChild(line) {
|
|
632
|
+
this.children.push(line);
|
|
633
|
+
}
|
|
634
|
+
recalculateDurations() {
|
|
635
|
+
if (this.exitStamp) {
|
|
636
|
+
this.duration.total = this.duration.self =
|
|
637
|
+
this.exitStamp - this.timestamp;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Log lines extend this class if they have a start-line and an end-line (and hence can have children in-between).
|
|
643
|
+
* - The start-line should extend "Method" and collect any children.
|
|
644
|
+
* - The end-line should extend "Detail" and terminate the method (also providing the "exitStamp").
|
|
645
|
+
* The method will be rendered as "expandable" in the tree-view, if it has children.
|
|
646
|
+
*/
|
|
647
|
+
export class Method extends TimedNode {
|
|
648
|
+
/**
|
|
649
|
+
* Whether the log event was truncated when the log ended, e,g no matching end event
|
|
650
|
+
*/
|
|
651
|
+
isTruncated = false;
|
|
652
|
+
constructor(parser, parts, exitTypes, timelineKey, cpuType) {
|
|
653
|
+
super(parser, parts, timelineKey, cpuType);
|
|
654
|
+
this.exitTypes = exitTypes;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* This class represents the single root node for the node tree.
|
|
659
|
+
* It is a "pseudo" node and not present in the log.
|
|
660
|
+
* Since it has children it extends "Method".
|
|
661
|
+
*/
|
|
662
|
+
export class ApexLog extends Method {
|
|
663
|
+
type = null;
|
|
664
|
+
text = "LOG_ROOT";
|
|
665
|
+
timestamp = 0;
|
|
666
|
+
exitStamp = 0;
|
|
667
|
+
/**
|
|
668
|
+
* The size of the log, in bytes
|
|
669
|
+
*/
|
|
670
|
+
size = 0;
|
|
671
|
+
/**
|
|
672
|
+
* The Apex Debug Logging Levels for the current log
|
|
673
|
+
*/
|
|
674
|
+
debugLevels = [];
|
|
675
|
+
/**
|
|
676
|
+
* All the namespaces that appear in this log.
|
|
677
|
+
*/
|
|
678
|
+
namespaces = [];
|
|
679
|
+
/**
|
|
680
|
+
* Any issues within the log, such as cpu time exceeded or max log size reached.
|
|
681
|
+
*/
|
|
682
|
+
logIssues = [];
|
|
683
|
+
/**
|
|
684
|
+
* Any issues that occurred during the parsing of the log, such as an unrecognized log event type.
|
|
685
|
+
*/
|
|
686
|
+
parsingErrors = [];
|
|
687
|
+
governorLimits = {
|
|
688
|
+
soqlQueries: { used: 0, limit: 0 },
|
|
689
|
+
soslQueries: { used: 0, limit: 0 },
|
|
690
|
+
queryRows: { used: 0, limit: 0 },
|
|
691
|
+
dmlStatements: { used: 0, limit: 0 },
|
|
692
|
+
publishImmediateDml: { used: 0, limit: 0 },
|
|
693
|
+
dmlRows: { used: 0, limit: 0 },
|
|
694
|
+
cpuTime: { used: 0, limit: 0 },
|
|
695
|
+
heapSize: { used: 0, limit: 0 },
|
|
696
|
+
callouts: { used: 0, limit: 0 },
|
|
697
|
+
emailInvocations: { used: 0, limit: 0 },
|
|
698
|
+
futureCalls: { used: 0, limit: 0 },
|
|
699
|
+
queueableJobsAddedToQueue: { used: 0, limit: 0 },
|
|
700
|
+
mobileApexPushCalls: { used: 0, limit: 0 },
|
|
701
|
+
byNamespace: new Map(),
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* The endtime with nodes of 0 duration excluded
|
|
705
|
+
*/
|
|
706
|
+
executionEndTime = 0;
|
|
707
|
+
constructor(parser) {
|
|
708
|
+
super(parser, null, [], "Code Unit", "");
|
|
709
|
+
}
|
|
710
|
+
setTimes() {
|
|
711
|
+
this.timestamp =
|
|
712
|
+
this.children.find((child) => {
|
|
713
|
+
return child.timestamp;
|
|
714
|
+
})?.timestamp || 0;
|
|
715
|
+
// We do not just want to use the very last exitStamp because it could be CUMULATIVE_USAGE which is not really part of the code execution time but does have a later time.
|
|
716
|
+
let endTime;
|
|
717
|
+
const reverseLen = this.children.length - 1;
|
|
718
|
+
for (let i = reverseLen; i >= 0; i--) {
|
|
719
|
+
const child = this.children[i];
|
|
720
|
+
// If there is no duration on a node then it is not going to be shown on the timeline anyway
|
|
721
|
+
if (child instanceof TimedNode && child.exitStamp) {
|
|
722
|
+
endTime ??= child.exitStamp;
|
|
723
|
+
if (child.duration) {
|
|
724
|
+
this.executionEndTime = child.exitStamp;
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
endTime ??= child?.timestamp;
|
|
729
|
+
}
|
|
730
|
+
this.exitStamp = endTime || 0;
|
|
731
|
+
this.recalculateDurations();
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
export function parseObjectNamespace(text) {
|
|
735
|
+
if (!text) {
|
|
736
|
+
return "";
|
|
737
|
+
}
|
|
738
|
+
const sep = text.indexOf("__");
|
|
739
|
+
if (sep === -1) {
|
|
740
|
+
return "default";
|
|
741
|
+
}
|
|
742
|
+
return text.slice(0, sep);
|
|
743
|
+
}
|
|
744
|
+
export function parseVfNamespace(text) {
|
|
745
|
+
const sep = text.indexOf("__");
|
|
746
|
+
if (sep === -1) {
|
|
747
|
+
return "default";
|
|
748
|
+
}
|
|
749
|
+
const firstSlash = text.indexOf("/");
|
|
750
|
+
if (firstSlash === -1) {
|
|
751
|
+
return "default";
|
|
752
|
+
}
|
|
753
|
+
const secondSlash = text.indexOf("/", firstSlash + 1);
|
|
754
|
+
if (secondSlash < 0) {
|
|
755
|
+
return "default";
|
|
756
|
+
}
|
|
757
|
+
return text.substring(secondSlash + 1, sep);
|
|
758
|
+
}
|
|
759
|
+
export function parseRows(text) {
|
|
760
|
+
if (!text) {
|
|
761
|
+
return 0;
|
|
762
|
+
}
|
|
763
|
+
const rowCount = text.slice(text.indexOf("Rows:") + 5);
|
|
764
|
+
if (rowCount) {
|
|
765
|
+
return Number(rowCount);
|
|
766
|
+
}
|
|
767
|
+
throw new Error(`Unable to parse row count: '${text}'`);
|
|
768
|
+
}
|
|
769
|
+
/* Log line entry Parsers */
|
|
770
|
+
class BulkHeapAllocateLine extends LogLine {
|
|
771
|
+
logCategory;
|
|
772
|
+
constructor(parser, parts) {
|
|
773
|
+
super(parser, parts);
|
|
774
|
+
this.text = parts[2] || "";
|
|
775
|
+
this.logCategory = "Apex Code";
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
class CalloutRequestLine extends LogLine {
|
|
779
|
+
constructor(parser, parts) {
|
|
780
|
+
super(parser, parts);
|
|
781
|
+
this.text = `${parts[3]} : ${parts[2]}`;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
class CalloutResponseLine extends LogLine {
|
|
785
|
+
constructor(parser, parts) {
|
|
786
|
+
super(parser, parts);
|
|
787
|
+
this.text = `${parts[3]} : ${parts[2]}`;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
class NamedCredentialRequestLine extends LogLine {
|
|
791
|
+
constructor(parser, parts) {
|
|
792
|
+
super(parser, parts);
|
|
793
|
+
this.text = `${parts[3]} : ${parts[4]} : ${parts[5]} : ${parts[6]}`;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
class NamedCredentialResponseLine extends LogLine {
|
|
797
|
+
constructor(parser, parts) {
|
|
798
|
+
super(parser, parts);
|
|
799
|
+
this.text = `${parts[2]}`;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
class NamedCredentialResponseDetailLine extends LogLine {
|
|
803
|
+
constructor(parser, parts) {
|
|
804
|
+
super(parser, parts);
|
|
805
|
+
this.text = `${parts[3]} : ${parts[4]} ${parts[5]} : ${parts[6]} ${parts[7]}`;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
class ConstructorEntryLine extends Method {
|
|
809
|
+
hasValidSymbols = true;
|
|
810
|
+
suffix = " (constructor)";
|
|
811
|
+
constructor(parser, parts) {
|
|
812
|
+
super(parser, parts, ["CONSTRUCTOR_EXIT"], "Method", "method");
|
|
813
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
814
|
+
const [, , , , args, className] = parts;
|
|
815
|
+
this.text = className + (args ? args.substring(args.lastIndexOf("(")) : "");
|
|
816
|
+
const possibleNS = this._parseConstructorNamespace(className || "");
|
|
817
|
+
if (possibleNS) {
|
|
818
|
+
this.namespace = possibleNS;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
_parseConstructorNamespace(className) {
|
|
822
|
+
let possibleNs = className.slice(0, className.indexOf("."));
|
|
823
|
+
if (this.logParser.namespaces.has(possibleNs)) {
|
|
824
|
+
return possibleNs;
|
|
825
|
+
}
|
|
826
|
+
const constructorParts = (className ?? "").split(".");
|
|
827
|
+
possibleNs = constructorParts[0] || "";
|
|
828
|
+
// inmner class with a namespace
|
|
829
|
+
if (constructorParts.length === 3) {
|
|
830
|
+
return possibleNs;
|
|
831
|
+
}
|
|
832
|
+
return "";
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
class ConstructorExitLine extends LogLine {
|
|
836
|
+
isExit = true;
|
|
837
|
+
constructor(parser, parts) {
|
|
838
|
+
super(parser, parts);
|
|
839
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
class EmailQueueLine extends LogLine {
|
|
843
|
+
acceptsText = true;
|
|
844
|
+
constructor(parser, parts) {
|
|
845
|
+
super(parser, parts);
|
|
846
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
export class MethodEntryLine extends Method {
|
|
850
|
+
hasValidSymbols = true;
|
|
851
|
+
constructor(parser, parts) {
|
|
852
|
+
super(parser, parts, ["METHOD_EXIT"], "Method", "method");
|
|
853
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
854
|
+
this.text = parts[4] || this.type || this.text;
|
|
855
|
+
if (this.text.indexOf("System.Type.forName(") !== -1) {
|
|
856
|
+
// assume we are not charged for class loading (or at least not lengthy remote-loading / compiling)
|
|
857
|
+
this.cpuType = "loading";
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
const possibleNs = this._parseMethodNamespace(parts[4]);
|
|
861
|
+
if (possibleNs) {
|
|
862
|
+
this.namespace = possibleNs;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
onEnd(end, _stack) {
|
|
867
|
+
if (end.namespace && !end.text.endsWith(")")) {
|
|
868
|
+
this.namespace = end.namespace;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
_parseMethodNamespace(methodName) {
|
|
872
|
+
if (!methodName) {
|
|
873
|
+
return "";
|
|
874
|
+
}
|
|
875
|
+
const methodBracketIndex = methodName.indexOf("(");
|
|
876
|
+
if (methodBracketIndex === -1) {
|
|
877
|
+
return "";
|
|
878
|
+
}
|
|
879
|
+
const nsSeparator = methodName.indexOf(".");
|
|
880
|
+
if (nsSeparator === -1) {
|
|
881
|
+
return "";
|
|
882
|
+
}
|
|
883
|
+
const possibleNs = methodName.slice(0, nsSeparator);
|
|
884
|
+
if (this.logParser.namespaces.has(possibleNs)) {
|
|
885
|
+
return possibleNs;
|
|
886
|
+
}
|
|
887
|
+
const methodNameParts = methodName.slice(0, methodBracketIndex)?.split(".");
|
|
888
|
+
if (methodNameParts.length === 4) {
|
|
889
|
+
return methodNameParts[0] ?? "";
|
|
890
|
+
}
|
|
891
|
+
else if (methodNameParts.length === 2) {
|
|
892
|
+
return "default";
|
|
893
|
+
}
|
|
894
|
+
return "";
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
class MethodExitLine extends LogLine {
|
|
898
|
+
isExit = true;
|
|
899
|
+
constructor(parser, parts) {
|
|
900
|
+
super(parser, parts);
|
|
901
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
902
|
+
this.text = parts[4] ?? parts[3] ?? this.text;
|
|
903
|
+
/*A method will end with ')'. Without that this it represents the first reference to a class, outer or inner. One of the few reliable ways to determine valid namespaces. The first reference to a class (outer or inner) will always have an METHOD_EXIT containing the Outer class name with namespace if present. Other events will follow, CONSTRUCTOR_ENTRY etc. But this case will only ever have 2 parts ns.Outer even if the first reference was actually an inner class e.g new ns.Outer.Inner();*/
|
|
904
|
+
// If does not end in ) then we have a reference to the class, either via outer or inner.
|
|
905
|
+
if (!this.text.endsWith(")")) {
|
|
906
|
+
// if there is a . the we have a namespace e.g ns.Outer
|
|
907
|
+
const index = this.text.indexOf(".");
|
|
908
|
+
if (index !== -1) {
|
|
909
|
+
this.namespace = this.text.slice(0, index);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
class SystemConstructorEntryLine extends Method {
|
|
915
|
+
suffix = "(system constructor)";
|
|
916
|
+
constructor(parser, parts) {
|
|
917
|
+
super(parser, parts, ["SYSTEM_CONSTRUCTOR_EXIT"], "System Method", "method");
|
|
918
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
919
|
+
this.text = parts[3] || "";
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
class SystemConstructorExitLine extends LogLine {
|
|
923
|
+
isExit = true;
|
|
924
|
+
constructor(parser, parts) {
|
|
925
|
+
super(parser, parts);
|
|
926
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
class SystemMethodEntryLine extends Method {
|
|
930
|
+
constructor(parser, parts) {
|
|
931
|
+
super(parser, parts, ["SYSTEM_METHOD_EXIT"], "System Method", "method");
|
|
932
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
933
|
+
this.text = parts[3] || "";
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
class SystemMethodExitLine extends LogLine {
|
|
937
|
+
isExit = true;
|
|
938
|
+
constructor(parser, parts) {
|
|
939
|
+
super(parser, parts);
|
|
940
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
export class CodeUnitStartedLine extends Method {
|
|
944
|
+
suffix = " (entrypoint)";
|
|
945
|
+
codeUnitType = "";
|
|
946
|
+
constructor(parser, parts) {
|
|
947
|
+
super(parser, parts, ["CODE_UNIT_FINISHED"], "Code Unit", "custom");
|
|
948
|
+
const typeString = parts[5] || parts[4] || parts[3] || "";
|
|
949
|
+
let sepIndex = typeString.indexOf(":");
|
|
950
|
+
if (sepIndex === -1) {
|
|
951
|
+
sepIndex = typeString.indexOf("/");
|
|
952
|
+
}
|
|
953
|
+
this.codeUnitType = sepIndex !== -1 ? typeString.slice(0, sepIndex) : "";
|
|
954
|
+
const name = parts[4] || parts[3] || this.codeUnitType || "";
|
|
955
|
+
switch (this.codeUnitType) {
|
|
956
|
+
case "EventService":
|
|
957
|
+
this.cpuType = "method";
|
|
958
|
+
this.namespace = parseObjectNamespace(typeString.slice(sepIndex + 1));
|
|
959
|
+
this.text = name;
|
|
960
|
+
break;
|
|
961
|
+
case "Validation":
|
|
962
|
+
this.cpuType = "custom";
|
|
963
|
+
this.declarative = true;
|
|
964
|
+
this.text = name;
|
|
965
|
+
break;
|
|
966
|
+
case "Workflow":
|
|
967
|
+
this.cpuType = "custom";
|
|
968
|
+
this.declarative = true;
|
|
969
|
+
this.text = name;
|
|
970
|
+
break;
|
|
971
|
+
case "Flow":
|
|
972
|
+
this.cpuType = "custom";
|
|
973
|
+
this.declarative = true;
|
|
974
|
+
this.text = name;
|
|
975
|
+
break;
|
|
976
|
+
case "VF":
|
|
977
|
+
this.cpuType = "method";
|
|
978
|
+
this.namespace = parseVfNamespace(name);
|
|
979
|
+
this.text = name;
|
|
980
|
+
break;
|
|
981
|
+
case "apex": {
|
|
982
|
+
this.cpuType = "method";
|
|
983
|
+
const namespaceIndex = name.indexOf(".");
|
|
984
|
+
this.namespace =
|
|
985
|
+
namespaceIndex !== -1
|
|
986
|
+
? name.slice(name.indexOf("apex://") + 7, namespaceIndex)
|
|
987
|
+
: "default";
|
|
988
|
+
this.text = name;
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
case "__sfdc_trigger": {
|
|
992
|
+
this.cpuType = "method";
|
|
993
|
+
this.text = name || parts[4] || "";
|
|
994
|
+
const triggerParts = parts[5]?.split("/") || "";
|
|
995
|
+
this.namespace =
|
|
996
|
+
triggerParts.length === 3 ? triggerParts[1] || "default" : "default";
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
default: {
|
|
1000
|
+
this.cpuType = "method";
|
|
1001
|
+
this.text = name;
|
|
1002
|
+
const openBracket = name.lastIndexOf("(");
|
|
1003
|
+
const methodName = openBracket !== -1
|
|
1004
|
+
? name.slice(0, openBracket + 1).split(".")
|
|
1005
|
+
: name.split(".");
|
|
1006
|
+
if (methodName.length === 3 ||
|
|
1007
|
+
(methodName.length === 2 && !methodName[1]?.endsWith("("))) {
|
|
1008
|
+
this.namespace = methodName[0] || "default";
|
|
1009
|
+
}
|
|
1010
|
+
break;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
this.namespace ||= "default";
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
export class CodeUnitFinishedLine extends LogLine {
|
|
1017
|
+
isExit = true;
|
|
1018
|
+
constructor(parser, parts) {
|
|
1019
|
+
super(parser, parts);
|
|
1020
|
+
this.text = parts[2] || "";
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
class VFApexCallStartLine extends Method {
|
|
1024
|
+
suffix = " (VF APEX)";
|
|
1025
|
+
invalidClasses = [
|
|
1026
|
+
"pagemessagescomponentcontroller",
|
|
1027
|
+
"pagemessagecomponentcontroller",
|
|
1028
|
+
"severitymessages",
|
|
1029
|
+
];
|
|
1030
|
+
constructor(parser, parts) {
|
|
1031
|
+
super(parser, parts, ["VF_APEX_CALL_END"], "Method", "method");
|
|
1032
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1033
|
+
const classText = parts[5] || parts[3] || "";
|
|
1034
|
+
let methodtext = parts[4] || "";
|
|
1035
|
+
if (!methodtext &&
|
|
1036
|
+
(!classText.includes(" ") ||
|
|
1037
|
+
this.invalidClasses.some((invalidCls) => classText.toLowerCase().includes(invalidCls)))) {
|
|
1038
|
+
// we have a system entry and they do not have exits
|
|
1039
|
+
// e.g |VF_APEX_CALL_START|[EXTERNAL]|/apexpage/pagemessagescomponentcontroller.apex <init>
|
|
1040
|
+
// and they really mess with the logs so skip handling them.
|
|
1041
|
+
this.exitTypes = [];
|
|
1042
|
+
}
|
|
1043
|
+
else if (methodtext) {
|
|
1044
|
+
this.hasValidSymbols = true;
|
|
1045
|
+
// method call
|
|
1046
|
+
const methodIndex = methodtext.indexOf("(");
|
|
1047
|
+
const constructorIndex = methodtext.indexOf("<init>");
|
|
1048
|
+
if (methodIndex > -1) {
|
|
1049
|
+
// Method
|
|
1050
|
+
methodtext =
|
|
1051
|
+
"." + methodtext.substring(methodIndex).slice(1, -1) + "()";
|
|
1052
|
+
}
|
|
1053
|
+
else if (constructorIndex > -1) {
|
|
1054
|
+
// Constructor
|
|
1055
|
+
methodtext = methodtext.substring(constructorIndex + 6) + "()";
|
|
1056
|
+
}
|
|
1057
|
+
else {
|
|
1058
|
+
// Property
|
|
1059
|
+
methodtext = "." + methodtext;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
else {
|
|
1063
|
+
this.hasValidSymbols = true;
|
|
1064
|
+
}
|
|
1065
|
+
this.text = classText + methodtext;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
class VFApexCallEndLine extends LogLine {
|
|
1069
|
+
isExit = true;
|
|
1070
|
+
constructor(parser, parts) {
|
|
1071
|
+
super(parser, parts);
|
|
1072
|
+
this.text = parts[2] || "";
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
class VFDeserializeViewstateBeginLine extends Method {
|
|
1076
|
+
constructor(parser, parts) {
|
|
1077
|
+
super(parser, parts, ["VF_DESERIALIZE_VIEWSTATE_END"], "System Method", "method");
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
class VFFormulaStartLine extends Method {
|
|
1081
|
+
suffix = " (VF FORMULA)";
|
|
1082
|
+
constructor(parser, parts) {
|
|
1083
|
+
super(parser, parts, ["VF_EVALUATE_FORMULA_END"], "System Method", "custom");
|
|
1084
|
+
this.text = parts[3] || "";
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
class VFFormulaEndLine extends LogLine {
|
|
1088
|
+
isExit = true;
|
|
1089
|
+
constructor(parser, parts) {
|
|
1090
|
+
super(parser, parts);
|
|
1091
|
+
this.text = parts[2] || "";
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
class VFSeralizeViewStateStartLine extends Method {
|
|
1095
|
+
constructor(parser, parts) {
|
|
1096
|
+
super(parser, parts, ["VF_SERIALIZE_VIEWSTATE_END"], "System Method", "method");
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
class VFPageMessageLine extends LogLine {
|
|
1100
|
+
acceptsText = true;
|
|
1101
|
+
constructor(parser, parts) {
|
|
1102
|
+
super(parser, parts);
|
|
1103
|
+
this.text = parts[2] || "";
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
class DMLBeginLine extends Method {
|
|
1107
|
+
dmlCount = {
|
|
1108
|
+
self: 1,
|
|
1109
|
+
total: 1,
|
|
1110
|
+
};
|
|
1111
|
+
namespace = "default";
|
|
1112
|
+
constructor(parser, parts) {
|
|
1113
|
+
super(parser, parts, ["DML_END"], "DML", "free");
|
|
1114
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1115
|
+
this.text = "DML " + parts[3] + " " + parts[4];
|
|
1116
|
+
const rowCountString = parts[5];
|
|
1117
|
+
this.dmlRowCount.total = this.dmlRowCount.self = rowCountString
|
|
1118
|
+
? parseRows(rowCountString)
|
|
1119
|
+
: 0;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
class DMLEndLine extends LogLine {
|
|
1123
|
+
isExit = true;
|
|
1124
|
+
constructor(parser, parts) {
|
|
1125
|
+
super(parser, parts);
|
|
1126
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
class IdeasQueryExecuteLine extends LogLine {
|
|
1130
|
+
constructor(parser, parts) {
|
|
1131
|
+
super(parser, parts);
|
|
1132
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
class SOQLExecuteBeginLine extends Method {
|
|
1136
|
+
aggregations = 0;
|
|
1137
|
+
soqlCount = {
|
|
1138
|
+
self: 1,
|
|
1139
|
+
total: 1,
|
|
1140
|
+
};
|
|
1141
|
+
constructor(parser, parts) {
|
|
1142
|
+
super(parser, parts, ["SOQL_EXECUTE_END"], "SOQL", "free");
|
|
1143
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1144
|
+
const [, , , aggregations, soqlString] = parts;
|
|
1145
|
+
const aggregationText = aggregations || "";
|
|
1146
|
+
if (aggregationText) {
|
|
1147
|
+
const aggregationIndex = aggregationText.indexOf("Aggregations:");
|
|
1148
|
+
this.aggregations = Number(aggregationText.slice(aggregationIndex + 13));
|
|
1149
|
+
}
|
|
1150
|
+
this.text = soqlString || "";
|
|
1151
|
+
}
|
|
1152
|
+
onEnd(end, _stack) {
|
|
1153
|
+
this.soqlRowCount.total = this.soqlRowCount.self = end.soqlRowCount.total;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
class SOQLExecuteEndLine extends LogLine {
|
|
1157
|
+
isExit = true;
|
|
1158
|
+
constructor(parser, parts) {
|
|
1159
|
+
super(parser, parts);
|
|
1160
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1161
|
+
this.soqlRowCount.total = this.soqlRowCount.self = parseRows(parts[3] || "");
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
class SOQLExecuteExplainLine extends LogLine {
|
|
1165
|
+
cardinality = null; // The estimated number of records that the leading operation type would return
|
|
1166
|
+
fields = null; //The indexed field(s) used by the Query Optimizer. If the leading operation type is Index, the fields value is Index. Otherwise, the fields value is null.
|
|
1167
|
+
leadingOperationType = null; // The primary operation type that Salesforce will use to optimize the query.
|
|
1168
|
+
relativeCost = null; // The cost of the query compared to the Force.com Query Optimizer’s selectivity threshold. Values above 1 mean that the query won’t be selective.
|
|
1169
|
+
sObjectCardinality = null; // The approximate record count for the queried object.
|
|
1170
|
+
sObjectType = null; //T he name of the queried SObject
|
|
1171
|
+
constructor(parser, parts) {
|
|
1172
|
+
super(parser, parts);
|
|
1173
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1174
|
+
const queryPlanDetails = parts[3] || "";
|
|
1175
|
+
this.text = queryPlanDetails;
|
|
1176
|
+
const queryplanParts = queryPlanDetails.split("],");
|
|
1177
|
+
if (queryplanParts.length > 1) {
|
|
1178
|
+
const planExplain = queryplanParts[0] || "";
|
|
1179
|
+
const [cardinalityText, sobjCardinalityText, costText] = (queryplanParts[1] || "").split(",");
|
|
1180
|
+
const onIndex = planExplain.indexOf(" on");
|
|
1181
|
+
this.leadingOperationType = planExplain.slice(0, onIndex);
|
|
1182
|
+
const colonIndex = planExplain.indexOf(" :");
|
|
1183
|
+
this.sObjectType = planExplain.slice(onIndex + 4, colonIndex);
|
|
1184
|
+
// remove whitespace if there is any. we could have [ field1__c, field2__c ]
|
|
1185
|
+
// I am not 100% sure of format when we have multiple fields so this is safer
|
|
1186
|
+
const fieldsAsString = planExplain
|
|
1187
|
+
.slice(planExplain.indexOf("[") + 1)
|
|
1188
|
+
.replace(/\s+/g, "");
|
|
1189
|
+
this.fields = fieldsAsString === "" ? [] : fieldsAsString.split(",");
|
|
1190
|
+
this.cardinality = cardinalityText
|
|
1191
|
+
? Number(cardinalityText.slice(cardinalityText.indexOf("cardinality: ") + 13))
|
|
1192
|
+
: null;
|
|
1193
|
+
this.sObjectCardinality = sobjCardinalityText
|
|
1194
|
+
? Number(sobjCardinalityText.slice(sobjCardinalityText.indexOf("sobjectCardinality: ") + 20))
|
|
1195
|
+
: null;
|
|
1196
|
+
this.relativeCost = costText
|
|
1197
|
+
? Number(costText.slice(costText.indexOf("relativeCost ") + 13))
|
|
1198
|
+
: null;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
class SOSLExecuteBeginLine extends Method {
|
|
1203
|
+
constructor(parser, parts) {
|
|
1204
|
+
super(parser, parts, ["SOSL_EXECUTE_END"], "SOQL", "free");
|
|
1205
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1206
|
+
this.text = `SOSL: ${parts[3]}`;
|
|
1207
|
+
this.soslCount = {
|
|
1208
|
+
self: 1,
|
|
1209
|
+
total: 1,
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
onEnd(end, _stack) {
|
|
1213
|
+
this.soslRowCount.total = this.soslRowCount.self = end.soslRowCount.total;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
class SOSLExecuteEndLine extends LogLine {
|
|
1217
|
+
isExit = true;
|
|
1218
|
+
constructor(parser, parts) {
|
|
1219
|
+
super(parser, parts);
|
|
1220
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1221
|
+
this.soslRowCount.total = this.soslRowCount.self = parseRows(parts[3] || "");
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
class HeapAllocateLine extends LogLine {
|
|
1225
|
+
constructor(parser, parts) {
|
|
1226
|
+
super(parser, parts);
|
|
1227
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1228
|
+
this.text = parts[3] || "";
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
class HeapDeallocateLine extends LogLine {
|
|
1232
|
+
constructor(parser, parts) {
|
|
1233
|
+
super(parser, parts);
|
|
1234
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
class StatementExecuteLine extends LogLine {
|
|
1238
|
+
constructor(parser, parts) {
|
|
1239
|
+
super(parser, parts);
|
|
1240
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
class VariableScopeBeginLine extends LogLine {
|
|
1244
|
+
constructor(parser, parts) {
|
|
1245
|
+
super(parser, parts);
|
|
1246
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1247
|
+
this.text = parts.slice(3).join(" | ");
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
class VariableAssignmentLine extends LogLine {
|
|
1251
|
+
constructor(parser, parts) {
|
|
1252
|
+
super(parser, parts);
|
|
1253
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1254
|
+
this.text = parts.slice(3).join(" | ");
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
class UserInfoLine extends LogLine {
|
|
1258
|
+
constructor(parser, parts) {
|
|
1259
|
+
super(parser, parts);
|
|
1260
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1261
|
+
this.text = parts[3] + " " + parts[4];
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
class UserDebugLine extends LogLine {
|
|
1265
|
+
acceptsText = true;
|
|
1266
|
+
constructor(parser, parts) {
|
|
1267
|
+
super(parser, parts);
|
|
1268
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1269
|
+
this.text = parts.slice(3).join(" | ");
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
class CumulativeLimitUsageLine extends Method {
|
|
1273
|
+
namespace = "default";
|
|
1274
|
+
constructor(parser, parts) {
|
|
1275
|
+
super(parser, parts, ["CUMULATIVE_LIMIT_USAGE_END"], "System Method", "system");
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
class CumulativeProfilingLine extends LogLine {
|
|
1279
|
+
acceptsText = true;
|
|
1280
|
+
namespace = "default";
|
|
1281
|
+
constructor(parser, parts) {
|
|
1282
|
+
super(parser, parts);
|
|
1283
|
+
this.text = parts[2] + " " + (parts[3] ?? "");
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
class CumulativeProfilingBeginLine extends Method {
|
|
1287
|
+
namespace = "default";
|
|
1288
|
+
constructor(parser, parts) {
|
|
1289
|
+
super(parser, parts, ["CUMULATIVE_PROFILING_END"], "System Method", "custom");
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
class LimitUsageLine extends LogLine {
|
|
1293
|
+
namespace = "default";
|
|
1294
|
+
constructor(parser, parts) {
|
|
1295
|
+
super(parser, parts);
|
|
1296
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1297
|
+
this.text = parts[3] + " " + parts[4] + " out of " + parts[5];
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
class LimitUsageForNSLine extends LogLine {
|
|
1301
|
+
static limitsKeys = new Map([
|
|
1302
|
+
["Number of SOQL queries", "soqlQueries"],
|
|
1303
|
+
["Number of query rows", "queryRows"],
|
|
1304
|
+
["Number of SOSL queries", "soslQueries"],
|
|
1305
|
+
["Number of DML statements", "dmlStatements"],
|
|
1306
|
+
["Number of Publish Immediate DML", "publishImmediateDml"],
|
|
1307
|
+
["Number of DML rows", "dmlRows"],
|
|
1308
|
+
["Maximum CPU time", "cpuTime"],
|
|
1309
|
+
["Maximum heap size", "heapSize"],
|
|
1310
|
+
["Number of callouts", "callouts"],
|
|
1311
|
+
["Number of Email Invocations", "emailInvocations"],
|
|
1312
|
+
["Number of future calls", "futureCalls"],
|
|
1313
|
+
[
|
|
1314
|
+
"Number of queueable jobs added to the queue",
|
|
1315
|
+
"queueableJobsAddedToQueue",
|
|
1316
|
+
],
|
|
1317
|
+
["Number of Mobile Apex push calls", "mobileApexPushCalls"],
|
|
1318
|
+
]);
|
|
1319
|
+
constructor(parser, parts) {
|
|
1320
|
+
super(parser, parts);
|
|
1321
|
+
this.acceptsText = true;
|
|
1322
|
+
this.namespace = "default";
|
|
1323
|
+
this.text = parts[2] || "";
|
|
1324
|
+
}
|
|
1325
|
+
onAfter(parser, _next) {
|
|
1326
|
+
// Parse the namespace from the first line (before any newline)
|
|
1327
|
+
this.namespace = this.text
|
|
1328
|
+
.slice(0, this.text.indexOf("\n"))
|
|
1329
|
+
.replace(/\(|\)/g, "");
|
|
1330
|
+
// Clean up the text for easier parsing
|
|
1331
|
+
const cleanedText = this.text
|
|
1332
|
+
.replace(/^\s+/gm, "")
|
|
1333
|
+
.replaceAll("******* CLOSE TO LIMIT", "")
|
|
1334
|
+
.replaceAll(" out of ", "/");
|
|
1335
|
+
this.text = cleanedText;
|
|
1336
|
+
// Split into lines and parse each line for limits
|
|
1337
|
+
const lines = cleanedText.split("\n");
|
|
1338
|
+
const limits = {
|
|
1339
|
+
soqlQueries: { used: 0, limit: 0 },
|
|
1340
|
+
soslQueries: { used: 0, limit: 0 },
|
|
1341
|
+
queryRows: { used: 0, limit: 0 },
|
|
1342
|
+
dmlStatements: { used: 0, limit: 0 },
|
|
1343
|
+
publishImmediateDml: { used: 0, limit: 0 },
|
|
1344
|
+
dmlRows: { used: 0, limit: 0 },
|
|
1345
|
+
cpuTime: { used: 0, limit: 0 },
|
|
1346
|
+
heapSize: { used: 0, limit: 0 },
|
|
1347
|
+
callouts: { used: 0, limit: 0 },
|
|
1348
|
+
emailInvocations: { used: 0, limit: 0 },
|
|
1349
|
+
futureCalls: { used: 0, limit: 0 },
|
|
1350
|
+
queueableJobsAddedToQueue: { used: 0, limit: 0 },
|
|
1351
|
+
mobileApexPushCalls: { used: 0, limit: 0 },
|
|
1352
|
+
};
|
|
1353
|
+
for (const line of lines) {
|
|
1354
|
+
// Match lines like: "Maximum CPU time: 15008/10000"
|
|
1355
|
+
const match = line.match(/^(.+?):\s*([\d,]+)\/([\d,]+)/);
|
|
1356
|
+
if (match) {
|
|
1357
|
+
const key = LimitUsageForNSLine.limitsKeys.get(match[1].trim());
|
|
1358
|
+
if (key) {
|
|
1359
|
+
const used = parseInt(match[2].replace(/,/g, ""), 10);
|
|
1360
|
+
const limit = parseInt(match[3].replace(/,/g, ""), 10);
|
|
1361
|
+
if (key) {
|
|
1362
|
+
limits[key] = { used, limit };
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
parser.governorLimits.byNamespace.set(this.namespace, limits);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
class NBANodeBegin extends Method {
|
|
1371
|
+
constructor(parser, parts) {
|
|
1372
|
+
super(parser, parts, ["NBA_NODE_END"], "System Method", "method");
|
|
1373
|
+
this.text = parts.slice(2).join(" | ");
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
class NBANodeDetail extends LogLine {
|
|
1377
|
+
constructor(parser, parts) {
|
|
1378
|
+
super(parser, parts);
|
|
1379
|
+
this.text = parts.slice(2).join(" | ");
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
class NBANodeEnd extends LogLine {
|
|
1383
|
+
isExit = true;
|
|
1384
|
+
constructor(parser, parts) {
|
|
1385
|
+
super(parser, parts);
|
|
1386
|
+
this.text = parts.slice(2).join(" | ");
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
class NBANodeError extends LogLine {
|
|
1390
|
+
constructor(parser, parts) {
|
|
1391
|
+
super(parser, parts);
|
|
1392
|
+
this.text = parts.slice(2).join(" | ");
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
class NBAOfferInvalid extends LogLine {
|
|
1396
|
+
constructor(parser, parts) {
|
|
1397
|
+
super(parser, parts);
|
|
1398
|
+
this.text = parts.slice(2).join(" | ");
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
class NBAStrategyBegin extends Method {
|
|
1402
|
+
constructor(parser, parts) {
|
|
1403
|
+
super(parser, parts, ["NBA_STRATEGY_END"], "System Method", "method");
|
|
1404
|
+
this.text = parts.slice(2).join(" | ");
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
class NBAStrategyEnd extends LogLine {
|
|
1408
|
+
isExit = true;
|
|
1409
|
+
constructor(parser, parts) {
|
|
1410
|
+
super(parser, parts);
|
|
1411
|
+
this.text = parts.slice(2).join(" | ");
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
class NBAStrategyError extends LogLine {
|
|
1415
|
+
constructor(parser, parts) {
|
|
1416
|
+
super(parser, parts);
|
|
1417
|
+
this.text = parts.slice(2).join(" | ");
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
class PushTraceFlagsLine extends LogLine {
|
|
1421
|
+
constructor(parser, parts) {
|
|
1422
|
+
super(parser, parts);
|
|
1423
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1424
|
+
this.text = parts[4] + ", line:" + this.lineNumber + " - " + parts[5];
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
class PopTraceFlagsLine extends LogLine {
|
|
1428
|
+
constructor(parser, parts) {
|
|
1429
|
+
super(parser, parts);
|
|
1430
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1431
|
+
this.text = parts[4] + ", line:" + this.lineNumber + " - " + parts[5];
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
class QueryMoreBeginLine extends Method {
|
|
1435
|
+
constructor(parser, parts) {
|
|
1436
|
+
super(parser, parts, ["QUERY_MORE_END"], "SOQL", "custom");
|
|
1437
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1438
|
+
this.text = `line: ${this.lineNumber}`;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
class QueryMoreEndLine extends LogLine {
|
|
1442
|
+
isExit = true;
|
|
1443
|
+
constructor(parser, parts) {
|
|
1444
|
+
super(parser, parts);
|
|
1445
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1446
|
+
this.text = `line: ${this.lineNumber}`;
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
class QueryMoreIterationsLine extends LogLine {
|
|
1450
|
+
constructor(parser, parts) {
|
|
1451
|
+
super(parser, parts);
|
|
1452
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1453
|
+
this.text = `line: ${this.lineNumber}, iterations:${parts[3]}`;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
class SavepointRollbackLine extends LogLine {
|
|
1457
|
+
constructor(parser, parts) {
|
|
1458
|
+
super(parser, parts);
|
|
1459
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1460
|
+
this.text = `${parts[3]}, line: ${this.lineNumber}`;
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
class SavePointSetLine extends LogLine {
|
|
1464
|
+
constructor(parser, parts) {
|
|
1465
|
+
super(parser, parts);
|
|
1466
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
1467
|
+
this.text = `${parts[3]}, line: ${this.lineNumber}`;
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
class TotalEmailRecipientsQueuedLine extends LogLine {
|
|
1471
|
+
constructor(parser, parts) {
|
|
1472
|
+
super(parser, parts);
|
|
1473
|
+
this.text = parts[2] || "";
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
class StackFrameVariableListLine extends LogLine {
|
|
1477
|
+
acceptsText = true;
|
|
1478
|
+
constructor(parser, parts) {
|
|
1479
|
+
super(parser, parts);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
class StaticVariableListLine extends LogLine {
|
|
1483
|
+
acceptsText = true;
|
|
1484
|
+
constructor(parser, parts) {
|
|
1485
|
+
super(parser, parts);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
// This looks like a method, but the exit line is often missing...
|
|
1489
|
+
class SystemModeEnterLine extends LogLine {
|
|
1490
|
+
// namespace = "system";
|
|
1491
|
+
constructor(parser, parts) {
|
|
1492
|
+
super(parser, parts);
|
|
1493
|
+
this.text = parts[2] || "";
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
class SystemModeExitLine extends LogLine {
|
|
1497
|
+
constructor(parser, parts) {
|
|
1498
|
+
super(parser, parts);
|
|
1499
|
+
this.text = parts[2] || "";
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
export class ExecutionStartedLine extends Method {
|
|
1503
|
+
namespace = "default";
|
|
1504
|
+
constructor(parser, parts) {
|
|
1505
|
+
super(parser, parts, ["EXECUTION_FINISHED"], "Method", "method");
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
class EnteringManagedPackageLine extends Method {
|
|
1509
|
+
constructor(parser, parts) {
|
|
1510
|
+
super(parser, parts, [], "Method", "pkg");
|
|
1511
|
+
const rawNs = parts[2] || "", lastDot = rawNs.lastIndexOf(".");
|
|
1512
|
+
this.text = this.namespace =
|
|
1513
|
+
lastDot < 0 ? rawNs : rawNs.substring(lastDot + 1);
|
|
1514
|
+
}
|
|
1515
|
+
onAfter(parser, end) {
|
|
1516
|
+
if (end) {
|
|
1517
|
+
this.exitStamp = end.timestamp;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
class EventSericePubBeginLine extends Method {
|
|
1522
|
+
constructor(parser, parts) {
|
|
1523
|
+
super(parser, parts, ["EVENT_SERVICE_PUB_END"], "Flow", "custom");
|
|
1524
|
+
this.text = parts[2] || "";
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
class EventSericePubEndLine extends LogLine {
|
|
1528
|
+
isExit = true;
|
|
1529
|
+
constructor(parser, parts) {
|
|
1530
|
+
super(parser, parts);
|
|
1531
|
+
this.text = parts[2] || "";
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
class EventSericePubDetailLine extends LogLine {
|
|
1535
|
+
constructor(parser, parts) {
|
|
1536
|
+
super(parser, parts);
|
|
1537
|
+
this.text = parts[2] + " " + parts[3] + " " + parts[4];
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
class EventSericeSubBeginLine extends Method {
|
|
1541
|
+
constructor(parser, parts) {
|
|
1542
|
+
super(parser, parts, ["EVENT_SERVICE_SUB_END"], "Flow", "custom");
|
|
1543
|
+
this.text = `${parts[2]} ${parts[3]}`;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
class EventSericeSubEndLine extends LogLine {
|
|
1547
|
+
isExit = true;
|
|
1548
|
+
constructor(parser, parts) {
|
|
1549
|
+
super(parser, parts);
|
|
1550
|
+
this.text = `${parts[2]} ${parts[3]}`;
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
class EventSericeSubDetailLine extends LogLine {
|
|
1554
|
+
constructor(parser, parts) {
|
|
1555
|
+
super(parser, parts);
|
|
1556
|
+
this.text = `${parts[2]} ${parts[3]} ${parts[4]} ${parts[6]} ${parts[6]}`;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
export class FlowStartInterviewsBeginLine extends Method {
|
|
1560
|
+
declarative = true;
|
|
1561
|
+
text = "FLOW_START_INTERVIEWS : ";
|
|
1562
|
+
constructor(parser, parts) {
|
|
1563
|
+
super(parser, parts, ["FLOW_START_INTERVIEWS_END"], "Flow", "custom");
|
|
1564
|
+
}
|
|
1565
|
+
onEnd(end, stack) {
|
|
1566
|
+
const flowType = this.getFlowType(stack);
|
|
1567
|
+
this.suffix = ` (${flowType})`;
|
|
1568
|
+
this.text += this.getFlowName();
|
|
1569
|
+
}
|
|
1570
|
+
getFlowType(stack) {
|
|
1571
|
+
let flowType;
|
|
1572
|
+
// ignore the last one on stack is it will be this FlowStartInterviewsBeginLine
|
|
1573
|
+
const len = stack.length - 2;
|
|
1574
|
+
for (let i = len; i >= 0; i--) {
|
|
1575
|
+
const elem = stack[i];
|
|
1576
|
+
// type = "CODE_UNIT_STARTED" a flow or Processbuilder was started directly
|
|
1577
|
+
// type = "FLOW_START_INTERVIEWS_BEGIN" a flow was started from a process builder
|
|
1578
|
+
if (elem instanceof CodeUnitStartedLine) {
|
|
1579
|
+
flowType = elem.codeUnitType === "Flow" ? "Flow" : "Process Builder";
|
|
1580
|
+
break;
|
|
1581
|
+
}
|
|
1582
|
+
else if (elem && elem.type === "FLOW_START_INTERVIEWS_BEGIN") {
|
|
1583
|
+
flowType = "Flow";
|
|
1584
|
+
break;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
return flowType || "";
|
|
1588
|
+
}
|
|
1589
|
+
getFlowName() {
|
|
1590
|
+
if (this.children.length) {
|
|
1591
|
+
return this.children[0]?.text || "";
|
|
1592
|
+
}
|
|
1593
|
+
return "";
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
class FlowStartInterviewsErrorLine extends LogLine {
|
|
1597
|
+
acceptsText = true;
|
|
1598
|
+
constructor(parser, parts) {
|
|
1599
|
+
super(parser, parts);
|
|
1600
|
+
this.text = `${parts[2]} - ${parts[4]}`;
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
class FlowStartInterviewBeginLine extends Method {
|
|
1604
|
+
constructor(parser, parts) {
|
|
1605
|
+
super(parser, parts, ["FLOW_START_INTERVIEW_END"], "Flow", "custom");
|
|
1606
|
+
this.text = parts[3] || "";
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
class FlowStartInterviewLimitUsageLine extends LogLine {
|
|
1610
|
+
constructor(parser, parts) {
|
|
1611
|
+
super(parser, parts);
|
|
1612
|
+
this.text = parts[2] || "";
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
class FlowStartScheduledRecordsLine extends LogLine {
|
|
1616
|
+
constructor(parser, parts) {
|
|
1617
|
+
super(parser, parts);
|
|
1618
|
+
this.text = `${parts[2]} : ${parts[3]}`;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
class FlowCreateInterviewErrorLine extends LogLine {
|
|
1622
|
+
constructor(parser, parts) {
|
|
1623
|
+
super(parser, parts);
|
|
1624
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]}`;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
class FlowElementBeginLine extends Method {
|
|
1628
|
+
declarative = true;
|
|
1629
|
+
constructor(parser, parts) {
|
|
1630
|
+
super(parser, parts, ["FLOW_ELEMENT_END"], "Flow", "custom");
|
|
1631
|
+
this.text = parts[3] + " " + parts[4];
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
class FlowElementDeferredLine extends LogLine {
|
|
1635
|
+
declarative = true;
|
|
1636
|
+
constructor(parser, parts) {
|
|
1637
|
+
super(parser, parts);
|
|
1638
|
+
this.text = parts[2] + " " + parts[3];
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
class FlowElementAssignmentLine extends LogLine {
|
|
1642
|
+
declarative = true;
|
|
1643
|
+
acceptsText = true;
|
|
1644
|
+
constructor(parser, parts) {
|
|
1645
|
+
super(parser, parts);
|
|
1646
|
+
this.text = parts[3] + " " + parts[4];
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
class FlowWaitEventResumingDetailLine extends LogLine {
|
|
1650
|
+
constructor(parser, parts) {
|
|
1651
|
+
super(parser, parts);
|
|
1652
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]}`;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
class FlowWaitEventWaitingDetailLine extends LogLine {
|
|
1656
|
+
constructor(parser, parts) {
|
|
1657
|
+
super(parser, parts);
|
|
1658
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]} : ${parts[6]}`;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
class FlowWaitResumingDetailLine extends LogLine {
|
|
1662
|
+
constructor(parser, parts) {
|
|
1663
|
+
super(parser, parts);
|
|
1664
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
class FlowWaitWaitingDetailLine extends LogLine {
|
|
1668
|
+
constructor(parser, parts) {
|
|
1669
|
+
super(parser, parts);
|
|
1670
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]}`;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
class FlowInterviewFinishedLine extends LogLine {
|
|
1674
|
+
constructor(parser, parts) {
|
|
1675
|
+
super(parser, parts);
|
|
1676
|
+
this.text = parts[3] || "";
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
class FlowInterviewResumedLine extends LogLine {
|
|
1680
|
+
constructor(parser, parts) {
|
|
1681
|
+
super(parser, parts);
|
|
1682
|
+
this.text = `${parts[2]} : ${parts[3]}`;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
class FlowInterviewPausedLine extends LogLine {
|
|
1686
|
+
constructor(parser, parts) {
|
|
1687
|
+
super(parser, parts);
|
|
1688
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
class FlowElementErrorLine extends LogLine {
|
|
1692
|
+
acceptsText = true;
|
|
1693
|
+
constructor(parser, parts) {
|
|
1694
|
+
super(parser, parts);
|
|
1695
|
+
this.text = parts[1] || "" + parts[2] + " " + parts[3] + " " + parts[4];
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
class FlowElementFaultLine extends LogLine {
|
|
1699
|
+
constructor(parser, parts) {
|
|
1700
|
+
super(parser, parts);
|
|
1701
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
class FlowElementLimitUsageLine extends LogLine {
|
|
1705
|
+
constructor(parser, parts) {
|
|
1706
|
+
super(parser, parts);
|
|
1707
|
+
this.text = `${parts[2]}`;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
class FlowInterviewFinishedLimitUsageLine extends LogLine {
|
|
1711
|
+
constructor(parser, parts) {
|
|
1712
|
+
super(parser, parts);
|
|
1713
|
+
this.text = `${parts[2]}`;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
class FlowSubflowDetailLine extends LogLine {
|
|
1717
|
+
constructor(parser, parts) {
|
|
1718
|
+
super(parser, parts);
|
|
1719
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]}`;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
class FlowActionCallDetailLine extends LogLine {
|
|
1723
|
+
constructor(parser, parts) {
|
|
1724
|
+
super(parser, parts);
|
|
1725
|
+
this.text =
|
|
1726
|
+
parts[3] + " : " + parts[4] + " : " + parts[5] + " : " + parts[6];
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
class FlowAssignmentDetailLine extends LogLine {
|
|
1730
|
+
constructor(parser, parts) {
|
|
1731
|
+
super(parser, parts);
|
|
1732
|
+
this.text = parts[3] + " : " + parts[4] + " : " + parts[5];
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
class FlowLoopDetailLine extends LogLine {
|
|
1736
|
+
constructor(parser, parts) {
|
|
1737
|
+
super(parser, parts);
|
|
1738
|
+
this.text = parts[3] + " : " + parts[4];
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
class FlowRuleDetailLine extends LogLine {
|
|
1742
|
+
constructor(parser, parts) {
|
|
1743
|
+
super(parser, parts);
|
|
1744
|
+
this.text = parts[3] + " : " + parts[4];
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
class FlowBulkElementBeginLine extends Method {
|
|
1748
|
+
declarative = true;
|
|
1749
|
+
constructor(parser, parts) {
|
|
1750
|
+
super(parser, parts, ["FLOW_BULK_ELEMENT_END"], "Flow", "custom");
|
|
1751
|
+
this.text = `${parts[2]} - ${parts[3]}`;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
class FlowBulkElementDetailLine extends LogLine {
|
|
1755
|
+
declarative = true;
|
|
1756
|
+
constructor(parser, parts) {
|
|
1757
|
+
super(parser, parts);
|
|
1758
|
+
this.text = parts[2] + " : " + parts[3] + " : " + parts[4];
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
class FlowBulkElementNotSupportedLine extends LogLine {
|
|
1762
|
+
constructor(parser, parts) {
|
|
1763
|
+
super(parser, parts);
|
|
1764
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
class FlowBulkElementLimitUsageLine extends LogLine {
|
|
1768
|
+
declarative = true;
|
|
1769
|
+
constructor(parser, parts) {
|
|
1770
|
+
super(parser, parts);
|
|
1771
|
+
this.text = parts[2] || "";
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
class PNInvalidAppLine extends LogLine {
|
|
1775
|
+
constructor(parser, parts) {
|
|
1776
|
+
super(parser, parts);
|
|
1777
|
+
this.text = `${parts[2]}.${parts[3]}`;
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
class PNInvalidCertificateLine extends LogLine {
|
|
1781
|
+
constructor(parser, parts) {
|
|
1782
|
+
super(parser, parts);
|
|
1783
|
+
this.text = `${parts[2]}.${parts[3]}`;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
class PNInvalidNotificationLine extends LogLine {
|
|
1787
|
+
constructor(parser, parts) {
|
|
1788
|
+
super(parser, parts);
|
|
1789
|
+
this.text = `${parts[2]}.${parts[3]} : ${parts[4]} : ${parts[5]} : ${parts[6]} : ${parts[7]} : ${parts[8]}`;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
class PNNoDevicesLine extends LogLine {
|
|
1793
|
+
constructor(parser, parts) {
|
|
1794
|
+
super(parser, parts);
|
|
1795
|
+
this.text = `${parts[2]}.${parts[3]}`;
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
class PNSentLine extends LogLine {
|
|
1799
|
+
constructor(parser, parts) {
|
|
1800
|
+
super(parser, parts);
|
|
1801
|
+
this.text = `${parts[2]}.${parts[3]} : ${parts[4]} : ${parts[5]} : ${parts[6]} : ${parts[7]}`;
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
class SLAEndLine extends LogLine {
|
|
1805
|
+
constructor(parser, parts) {
|
|
1806
|
+
super(parser, parts);
|
|
1807
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]} : ${parts[6]}`;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
class SLAEvalMilestoneLine extends LogLine {
|
|
1811
|
+
constructor(parser, parts) {
|
|
1812
|
+
super(parser, parts);
|
|
1813
|
+
this.text = `${parts[2]}`;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
class SLAProcessCaseLine extends LogLine {
|
|
1817
|
+
constructor(parser, parts) {
|
|
1818
|
+
super(parser, parts);
|
|
1819
|
+
this.text = `${parts[2]}`;
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
class TestingLimitsLine extends LogLine {
|
|
1823
|
+
acceptsText = true;
|
|
1824
|
+
constructor(parser, parts) {
|
|
1825
|
+
super(parser, parts);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
class ValidationRuleLine extends LogLine {
|
|
1829
|
+
constructor(parser, parts) {
|
|
1830
|
+
super(parser, parts);
|
|
1831
|
+
this.text = parts[3] || "";
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
class ValidationErrorLine extends LogLine {
|
|
1835
|
+
acceptsText = true;
|
|
1836
|
+
constructor(parser, parts) {
|
|
1837
|
+
super(parser, parts);
|
|
1838
|
+
this.text = parts[2] || "";
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
class ValidationFormulaLine extends LogLine {
|
|
1842
|
+
acceptsText = true;
|
|
1843
|
+
constructor(parser, parts) {
|
|
1844
|
+
super(parser, parts);
|
|
1845
|
+
const extra = parts.length > 3 ? " " + parts[3] : "";
|
|
1846
|
+
this.text = parts[2] + extra;
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
class ValidationPassLine extends LogLine {
|
|
1850
|
+
constructor(parser, parts) {
|
|
1851
|
+
super(parser, parts);
|
|
1852
|
+
this.text = parts[3] || "";
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
class WFFlowActionErrorLine extends LogLine {
|
|
1856
|
+
acceptsText = true;
|
|
1857
|
+
constructor(parser, parts) {
|
|
1858
|
+
super(parser, parts);
|
|
1859
|
+
this.text = parts[1] + " " + parts[4];
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
class WFFlowActionErrorDetailLine extends LogLine {
|
|
1863
|
+
acceptsText = true;
|
|
1864
|
+
constructor(parser, parts) {
|
|
1865
|
+
super(parser, parts);
|
|
1866
|
+
this.text = parts[1] + " " + parts[2];
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
class WFFieldUpdateLine extends Method {
|
|
1870
|
+
isExit = true;
|
|
1871
|
+
nextLineIsExit = true;
|
|
1872
|
+
constructor(parser, parts) {
|
|
1873
|
+
super(parser, parts, ["WF_FIELD_UPDATE"], "Workflow", "custom");
|
|
1874
|
+
this.text =
|
|
1875
|
+
" " +
|
|
1876
|
+
parts[2] +
|
|
1877
|
+
" " +
|
|
1878
|
+
parts[3] +
|
|
1879
|
+
" " +
|
|
1880
|
+
parts[4] +
|
|
1881
|
+
" " +
|
|
1882
|
+
parts[5] +
|
|
1883
|
+
" " +
|
|
1884
|
+
parts[6];
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
class WFRuleEvalBeginLine extends Method {
|
|
1888
|
+
declarative = true;
|
|
1889
|
+
constructor(parser, parts) {
|
|
1890
|
+
super(parser, parts, ["WF_RULE_EVAL_END"], "Workflow", "custom");
|
|
1891
|
+
this.text = parts[2] || "";
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
class WFRuleEvalValueLine extends LogLine {
|
|
1895
|
+
constructor(parser, parts) {
|
|
1896
|
+
super(parser, parts);
|
|
1897
|
+
this.text = parts[2] || "";
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
class WFRuleFilterLine extends LogLine {
|
|
1901
|
+
acceptsText = true;
|
|
1902
|
+
constructor(parser, parts) {
|
|
1903
|
+
super(parser, parts);
|
|
1904
|
+
this.text = parts[2] || "";
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
class WFCriteriaBeginLine extends Method {
|
|
1908
|
+
declarative = true;
|
|
1909
|
+
constructor(parser, parts) {
|
|
1910
|
+
super(parser, parts, ["WF_CRITERIA_END", "WF_RULE_NOT_EVALUATED"], "Workflow", "custom");
|
|
1911
|
+
this.text = "WF_CRITERIA : " + parts[5] + " : " + parts[3];
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
class WFFormulaLine extends Method {
|
|
1915
|
+
acceptsText = true;
|
|
1916
|
+
isExit = true;
|
|
1917
|
+
nextLineIsExit = true;
|
|
1918
|
+
constructor(parser, parts) {
|
|
1919
|
+
super(parser, parts, ["WF_FORMULA"], "Workflow", "custom");
|
|
1920
|
+
this.text = parts[2] + " : " + parts[3];
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
class WFActionLine extends LogLine {
|
|
1924
|
+
constructor(parser, parts) {
|
|
1925
|
+
super(parser, parts);
|
|
1926
|
+
this.text = parts[2] || "";
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
class WFActionsEndLine extends LogLine {
|
|
1930
|
+
constructor(parser, parts) {
|
|
1931
|
+
super(parser, parts);
|
|
1932
|
+
this.text = parts[2] || "";
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
class WFActionTaskLine extends LogLine {
|
|
1936
|
+
constructor(parser, parts) {
|
|
1937
|
+
super(parser, parts);
|
|
1938
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]} : ${parts[6]} : ${parts[7]}`;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
class WFApprovalLine extends Method {
|
|
1942
|
+
isExit = true;
|
|
1943
|
+
nextLineIsExit = true;
|
|
1944
|
+
constructor(parser, parts) {
|
|
1945
|
+
super(parser, parts, ["WF_APPROVAL"], "Workflow", "custom");
|
|
1946
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
class WFApprovalRemoveLine extends LogLine {
|
|
1950
|
+
constructor(parser, parts) {
|
|
1951
|
+
super(parser, parts);
|
|
1952
|
+
this.text = `${parts[2]}`;
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
class WFApprovalSubmitLine extends Method {
|
|
1956
|
+
isExit = true;
|
|
1957
|
+
nextLineIsExit = true;
|
|
1958
|
+
constructor(parser, parts) {
|
|
1959
|
+
super(parser, parts, ["WF_APPROVAL_SUBMIT"], "Workflow", "custom");
|
|
1960
|
+
this.text = `${parts[2]}`;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
class WFApprovalSubmitterLine extends LogLine {
|
|
1964
|
+
constructor(parser, parts) {
|
|
1965
|
+
super(parser, parts);
|
|
1966
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
class WFAssignLine extends LogLine {
|
|
1970
|
+
constructor(parser, parts) {
|
|
1971
|
+
super(parser, parts);
|
|
1972
|
+
this.text = `${parts[2]} : ${parts[3]}`;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
class WFEmailAlertLine extends Method {
|
|
1976
|
+
isExit = true;
|
|
1977
|
+
nextLineIsExit = true;
|
|
1978
|
+
constructor(parser, parts) {
|
|
1979
|
+
super(parser, parts, ["WF_EMAIL_ALERT"], "Workflow", "custom");
|
|
1980
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
class WFEmailSentLine extends Method {
|
|
1984
|
+
isExit = true;
|
|
1985
|
+
nextLineIsExit = true;
|
|
1986
|
+
constructor(parser, parts) {
|
|
1987
|
+
super(parser, parts, ["WF_EMAIL_SENT"], "Workflow", "custom");
|
|
1988
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
class WFEnqueueActionsLine extends LogLine {
|
|
1992
|
+
constructor(parser, parts) {
|
|
1993
|
+
super(parser, parts);
|
|
1994
|
+
this.text = parts[2] || "";
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
class WFEscalationActionLine extends LogLine {
|
|
1998
|
+
constructor(parser, parts) {
|
|
1999
|
+
super(parser, parts);
|
|
2000
|
+
this.text = `${parts[2]} : ${parts[3]}`;
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
class WFEvalEntryCriteriaLine extends Method {
|
|
2004
|
+
isExit = true;
|
|
2005
|
+
nextLineIsExit = true;
|
|
2006
|
+
constructor(parser, parts) {
|
|
2007
|
+
super(parser, parts, ["WF_EVAL_ENTRY_CRITERIA"], "Workflow", "custom");
|
|
2008
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
class WFFlowActionDetailLine extends LogLine {
|
|
2012
|
+
constructor(parser, parts) {
|
|
2013
|
+
super(parser, parts);
|
|
2014
|
+
const optional = parts[4] ? ` : ${parts[4]} :${parts[5]}` : "";
|
|
2015
|
+
this.text = `${parts[2]} : ${parts[3]}` + optional;
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
class WFNextApproverLine extends Method {
|
|
2019
|
+
isExit = true;
|
|
2020
|
+
nextLineIsExit = true;
|
|
2021
|
+
constructor(parser, parts) {
|
|
2022
|
+
super(parser, parts, ["WF_NEXT_APPROVER"], "Workflow", "custom");
|
|
2023
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]}`;
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
class WFOutboundMsgLine extends LogLine {
|
|
2027
|
+
constructor(parser, parts) {
|
|
2028
|
+
super(parser, parts);
|
|
2029
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]}`;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
class WFProcessFoundLine extends Method {
|
|
2033
|
+
isExit = true;
|
|
2034
|
+
nextLineIsExit = true;
|
|
2035
|
+
constructor(parser, parts) {
|
|
2036
|
+
super(parser, parts, ["WF_PROCESS_FOUND"], "Workflow", "custom");
|
|
2037
|
+
this.text = `${parts[2]} : ${parts[3]}`;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
class WFProcessNode extends Method {
|
|
2041
|
+
isExit = true;
|
|
2042
|
+
nextLineIsExit = true;
|
|
2043
|
+
constructor(parser, parts) {
|
|
2044
|
+
super(parser, parts, ["WF_PROCESS_NODE"], "Workflow", "custom");
|
|
2045
|
+
this.text = parts[2] || "";
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
class WFReassignRecordLine extends LogLine {
|
|
2049
|
+
constructor(parser, parts) {
|
|
2050
|
+
super(parser, parts);
|
|
2051
|
+
this.text = `${parts[2]} : ${parts[3]}`;
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
class WFResponseNotifyLine extends LogLine {
|
|
2055
|
+
constructor(parser, parts) {
|
|
2056
|
+
super(parser, parts);
|
|
2057
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]}`;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
class WFRuleEntryOrderLine extends LogLine {
|
|
2061
|
+
constructor(parser, parts) {
|
|
2062
|
+
super(parser, parts);
|
|
2063
|
+
this.text = parts[2] || "";
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
class WFRuleInvocationLine extends Method {
|
|
2067
|
+
isExit = true;
|
|
2068
|
+
nextLineIsExit = true;
|
|
2069
|
+
constructor(parser, parts) {
|
|
2070
|
+
super(parser, parts, ["WF_RULE_INVOCATION"], "Workflow", "custom");
|
|
2071
|
+
this.text = parts[2] || "";
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
class WFSoftRejectLine extends LogLine {
|
|
2075
|
+
constructor(parser, parts) {
|
|
2076
|
+
super(parser, parts);
|
|
2077
|
+
this.text = parts[2] || "";
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
class WFTimeTriggerLine extends LogLine {
|
|
2081
|
+
constructor(parser, parts) {
|
|
2082
|
+
super(parser, parts);
|
|
2083
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]}`;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
class WFSpoolActionBeginLine extends LogLine {
|
|
2087
|
+
constructor(parser, parts) {
|
|
2088
|
+
super(parser, parts);
|
|
2089
|
+
this.text = parts[2] || "";
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
class ExceptionThrownLine extends LogLine {
|
|
2093
|
+
discontinuity = true;
|
|
2094
|
+
acceptsText = true;
|
|
2095
|
+
totalThrownCount = 1;
|
|
2096
|
+
constructor(parser, parts) {
|
|
2097
|
+
super(parser, parts);
|
|
2098
|
+
this.lineNumber = this.parseLineNumber(parts[2]);
|
|
2099
|
+
this.text = parts[3] || "";
|
|
2100
|
+
}
|
|
2101
|
+
onAfter(parser, _next) {
|
|
2102
|
+
if (this.text.indexOf("System.LimitException") >= 0) {
|
|
2103
|
+
const isMultiLine = this.text.indexOf("\n");
|
|
2104
|
+
const len = isMultiLine < 0 ? 99 : isMultiLine;
|
|
2105
|
+
const truncateText = this.text.length > len;
|
|
2106
|
+
const summary = this.text.slice(0, len + 1) + (truncateText ? "…" : "");
|
|
2107
|
+
const message = truncateText ? this.text : "";
|
|
2108
|
+
parser.addLogIssue(this.timestamp, summary, message, "error");
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
class FatalErrorLine extends LogLine {
|
|
2113
|
+
acceptsText = true;
|
|
2114
|
+
hideable = false;
|
|
2115
|
+
discontinuity = true;
|
|
2116
|
+
constructor(parser, parts) {
|
|
2117
|
+
super(parser, parts);
|
|
2118
|
+
this.text = parts[2] || "";
|
|
2119
|
+
}
|
|
2120
|
+
onAfter(parser, _next) {
|
|
2121
|
+
const newLineIndex = this.text.indexOf("\n");
|
|
2122
|
+
const summary = newLineIndex > -1 ? this.text.slice(0, newLineIndex + 1) : this.text;
|
|
2123
|
+
const detailText = summary.length !== this.text.length ? this.text : "";
|
|
2124
|
+
parser.addLogIssue(this.timestamp, "FATAL ERROR! cause=" + summary, detailText, "error");
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
class XDSDetailLine extends LogLine {
|
|
2128
|
+
constructor(parser, parts) {
|
|
2129
|
+
super(parser, parts);
|
|
2130
|
+
this.text = parts[2] || "";
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
class XDSResponseLine extends LogLine {
|
|
2134
|
+
constructor(parser, parts) {
|
|
2135
|
+
super(parser, parts);
|
|
2136
|
+
this.text = `${parts[2]} : ${parts[3]} : ${parts[4]} : ${parts[5]} : ${parts[6]}`;
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
class XDSResponseDetailLine extends LogLine {
|
|
2140
|
+
constructor(parser, parts) {
|
|
2141
|
+
super(parser, parts);
|
|
2142
|
+
this.text = parts[2] || "";
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
class XDSResponseErrorLine extends LogLine {
|
|
2146
|
+
constructor(parser, parts) {
|
|
2147
|
+
super(parser, parts);
|
|
2148
|
+
this.text = parts[2] || "";
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
// e.g. "09:45:31.888 (38889007737)|DUPLICATE_DETECTION_BEGIN"
|
|
2152
|
+
class DuplicateDetectionBegin extends Method {
|
|
2153
|
+
declarative = true;
|
|
2154
|
+
constructor(parser, parts) {
|
|
2155
|
+
super(parser, parts, ["DUPLICATE_DETECTION_END"], "Workflow", "custom");
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
// e.g. "09:45:31.888 (38889067408)|DUPLICATE_DETECTION_RULE_INVOCATION|DuplicateRuleId:0Bm20000000CaSP|DuplicateRuleName:Duplicate Account|DmlType:UPDATE"
|
|
2159
|
+
class DuplicateDetectionRule extends LogLine {
|
|
2160
|
+
constructor(parser, parts) {
|
|
2161
|
+
super(parser, parts);
|
|
2162
|
+
this.text = `${parts[3]} - ${parts[4]}`;
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
/**
|
|
2166
|
+
* NOTE: These can be found in the org on the create new debug level page but are not found in the docs here
|
|
2167
|
+
* https://help.salesforce.com/s/articleView?id=sf.code_setting_debug_log_levels.htm
|
|
2168
|
+
*/
|
|
2169
|
+
class BulkDMLEntry extends LogLine {
|
|
2170
|
+
constructor(parser, parts) {
|
|
2171
|
+
super(parser, parts);
|
|
2172
|
+
this.text = parts[2] || "";
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* DUPLICATE_DETECTION_MATCH_INVOCATION_DETAILS|EntityType:Account|ActionTaken:Allow_[Alert,Report]|DuplicateRecordIds:
|
|
2177
|
+
*/
|
|
2178
|
+
class DuplicateDetectionDetails extends LogLine {
|
|
2179
|
+
constructor(parser, parts) {
|
|
2180
|
+
super(parser, parts);
|
|
2181
|
+
this.text = parts.slice(2).join(" | ");
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
/**
|
|
2185
|
+
* DUPLICATE_DETECTION_MATCH_INVOCATION_SUMMARY|EntityType:Account|NumRecordsToBeSaved:200|NumRecordsToBeSavedWithDuplicates:0|NumDuplicateRecordsFound:0
|
|
2186
|
+
*/
|
|
2187
|
+
class DuplicateDetectionSummary extends LogLine {
|
|
2188
|
+
constructor(parser, parts) {
|
|
2189
|
+
super(parser, parts);
|
|
2190
|
+
this.text = parts.slice(2).join(" | ");
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
class SessionCachePutBegin extends Method {
|
|
2194
|
+
constructor(parser, parts) {
|
|
2195
|
+
super(parser, parts, ["SESSION_CACHE_PUT_END"], "Method", "method");
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
class SessionCacheGetBegin extends Method {
|
|
2199
|
+
constructor(parser, parts) {
|
|
2200
|
+
super(parser, parts, ["SESSION_CACHE_GET_END"], "Method", "method");
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
class SessionCacheRemoveBegin extends Method {
|
|
2204
|
+
constructor(parser, parts) {
|
|
2205
|
+
super(parser, parts, ["SESSION_CACHE_REMOVE_END"], "Method", "method");
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
class OrgCachePutBegin extends Method {
|
|
2209
|
+
constructor(parser, parts) {
|
|
2210
|
+
super(parser, parts, ["ORG_CACHE_PUT_END"], "Method", "method");
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
class OrgCacheGetBegin extends Method {
|
|
2214
|
+
constructor(parser, parts) {
|
|
2215
|
+
super(parser, parts, ["ORG_CACHE_GET_END"], "Method", "method");
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
class OrgCacheRemoveBegin extends Method {
|
|
2219
|
+
constructor(parser, parts) {
|
|
2220
|
+
super(parser, parts, ["ORG_CACHE_REMOVE_END"], "Method", "method");
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
class VFSerializeContinuationStateBegin extends Method {
|
|
2224
|
+
constructor(parser, parts) {
|
|
2225
|
+
super(parser, parts, ["VF_SERIALIZE_CONTINUATION_STATE_END"], "Method", "method");
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
class VFDeserializeContinuationStateBegin extends Method {
|
|
2229
|
+
constructor(parser, parts) {
|
|
2230
|
+
super(parser, parts, ["VF_SERIALIZE_CONTINUATION_STATE_END"], "Method", "method");
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
class MatchEngineBegin extends Method {
|
|
2234
|
+
constructor(parser, parts) {
|
|
2235
|
+
super(parser, parts, ["MATCH_ENGINE_END"], "Method", "method");
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
function getLogEventClass(eventName) {
|
|
2239
|
+
if (!eventName) {
|
|
2240
|
+
return null;
|
|
2241
|
+
}
|
|
2242
|
+
// Fast path for the most commonly occuring types
|
|
2243
|
+
switch (eventName) {
|
|
2244
|
+
case "METHOD_ENTRY":
|
|
2245
|
+
return MethodEntryLine;
|
|
2246
|
+
case "METHOD_EXIT":
|
|
2247
|
+
return MethodExitLine;
|
|
2248
|
+
case "CONSTRUCTOR_ENTRY":
|
|
2249
|
+
return ConstructorEntryLine;
|
|
2250
|
+
case "CONSTRUCTOR_EXIT":
|
|
2251
|
+
return ConstructorExitLine;
|
|
2252
|
+
default:
|
|
2253
|
+
break;
|
|
2254
|
+
}
|
|
2255
|
+
// Handle all other types
|
|
2256
|
+
const logType = lineTypeMap.get(eventName);
|
|
2257
|
+
if (logType) {
|
|
2258
|
+
return logType;
|
|
2259
|
+
}
|
|
2260
|
+
else if (basicLogEvents.indexOf(eventName) !== -1) {
|
|
2261
|
+
return BasicLogLine;
|
|
2262
|
+
}
|
|
2263
|
+
else if (basicExitLogEvents.indexOf(eventName) !== -1) {
|
|
2264
|
+
return BasicExitLine;
|
|
2265
|
+
}
|
|
2266
|
+
return null;
|
|
2267
|
+
}
|
|
2268
|
+
export const lineTypeMap = new Map([
|
|
2269
|
+
["BULK_DML_RETRY", BulkDMLEntry],
|
|
2270
|
+
["BULK_HEAP_ALLOCATE", BulkHeapAllocateLine],
|
|
2271
|
+
["CALLOUT_REQUEST", CalloutRequestLine],
|
|
2272
|
+
["CALLOUT_RESPONSE", CalloutResponseLine],
|
|
2273
|
+
["NAMED_CREDENTIAL_REQUEST", NamedCredentialRequestLine],
|
|
2274
|
+
["NAMED_CREDENTIAL_RESPONSE", NamedCredentialResponseLine],
|
|
2275
|
+
["NAMED_CREDENTIAL_RESPONSE_DETAIL", NamedCredentialResponseDetailLine],
|
|
2276
|
+
["CONSTRUCTOR_ENTRY", ConstructorEntryLine],
|
|
2277
|
+
["CONSTRUCTOR_EXIT", ConstructorExitLine],
|
|
2278
|
+
["EMAIL_QUEUE", EmailQueueLine],
|
|
2279
|
+
["METHOD_ENTRY", MethodEntryLine],
|
|
2280
|
+
["METHOD_EXIT", MethodExitLine],
|
|
2281
|
+
["SYSTEM_CONSTRUCTOR_ENTRY", SystemConstructorEntryLine],
|
|
2282
|
+
["SYSTEM_CONSTRUCTOR_EXIT", SystemConstructorExitLine],
|
|
2283
|
+
["SYSTEM_METHOD_ENTRY", SystemMethodEntryLine],
|
|
2284
|
+
["SYSTEM_METHOD_EXIT", SystemMethodExitLine],
|
|
2285
|
+
["CODE_UNIT_STARTED", CodeUnitStartedLine],
|
|
2286
|
+
["CODE_UNIT_FINISHED", CodeUnitFinishedLine],
|
|
2287
|
+
["VF_APEX_CALL_START", VFApexCallStartLine],
|
|
2288
|
+
["VF_APEX_CALL_END", VFApexCallEndLine],
|
|
2289
|
+
["VF_DESERIALIZE_VIEWSTATE_BEGIN", VFDeserializeViewstateBeginLine],
|
|
2290
|
+
["VF_EVALUATE_FORMULA_BEGIN", VFFormulaStartLine],
|
|
2291
|
+
["VF_EVALUATE_FORMULA_END", VFFormulaEndLine],
|
|
2292
|
+
[
|
|
2293
|
+
"VF_SERIALIZE_CONTINUATION_STATE_BEGIN",
|
|
2294
|
+
VFSerializeContinuationStateBegin,
|
|
2295
|
+
],
|
|
2296
|
+
[
|
|
2297
|
+
"VF_DESERIALIZE_CONTINUATION_STATE_BEGIN",
|
|
2298
|
+
VFDeserializeContinuationStateBegin,
|
|
2299
|
+
],
|
|
2300
|
+
["VF_SERIALIZE_VIEWSTATE_BEGIN", VFSeralizeViewStateStartLine],
|
|
2301
|
+
["VF_PAGE_MESSAGE", VFPageMessageLine],
|
|
2302
|
+
["DML_BEGIN", DMLBeginLine],
|
|
2303
|
+
["DML_END", DMLEndLine],
|
|
2304
|
+
["IDEAS_QUERY_EXECUTE", IdeasQueryExecuteLine],
|
|
2305
|
+
["SOQL_EXECUTE_BEGIN", SOQLExecuteBeginLine],
|
|
2306
|
+
["SOQL_EXECUTE_END", SOQLExecuteEndLine],
|
|
2307
|
+
["SOQL_EXECUTE_EXPLAIN", SOQLExecuteExplainLine],
|
|
2308
|
+
["SOSL_EXECUTE_BEGIN", SOSLExecuteBeginLine],
|
|
2309
|
+
["SOSL_EXECUTE_END", SOSLExecuteEndLine],
|
|
2310
|
+
["HEAP_ALLOCATE", HeapAllocateLine],
|
|
2311
|
+
["HEAP_DEALLOCATE", HeapDeallocateLine],
|
|
2312
|
+
["STATEMENT_EXECUTE", StatementExecuteLine],
|
|
2313
|
+
["VARIABLE_SCOPE_BEGIN", VariableScopeBeginLine],
|
|
2314
|
+
["VARIABLE_ASSIGNMENT", VariableAssignmentLine],
|
|
2315
|
+
["USER_INFO", UserInfoLine],
|
|
2316
|
+
["USER_DEBUG", UserDebugLine],
|
|
2317
|
+
["CUMULATIVE_LIMIT_USAGE", CumulativeLimitUsageLine],
|
|
2318
|
+
["CUMULATIVE_PROFILING", CumulativeProfilingLine],
|
|
2319
|
+
["CUMULATIVE_PROFILING_BEGIN", CumulativeProfilingBeginLine],
|
|
2320
|
+
["LIMIT_USAGE", LimitUsageLine],
|
|
2321
|
+
["LIMIT_USAGE_FOR_NS", LimitUsageForNSLine],
|
|
2322
|
+
["NBA_NODE_BEGIN", NBANodeBegin],
|
|
2323
|
+
["NBA_NODE_DETAIL", NBANodeDetail],
|
|
2324
|
+
["NBA_NODE_END", NBANodeEnd],
|
|
2325
|
+
["NBA_NODE_ERROR", NBANodeError],
|
|
2326
|
+
["NBA_OFFER_INVALID", NBAOfferInvalid],
|
|
2327
|
+
["NBA_STRATEGY_BEGIN", NBAStrategyBegin],
|
|
2328
|
+
["NBA_STRATEGY_END", NBAStrategyEnd],
|
|
2329
|
+
["NBA_STRATEGY_ERROR", NBAStrategyError],
|
|
2330
|
+
["POP_TRACE_FLAGS", PopTraceFlagsLine],
|
|
2331
|
+
["PUSH_TRACE_FLAGS", PushTraceFlagsLine],
|
|
2332
|
+
["QUERY_MORE_BEGIN", QueryMoreBeginLine],
|
|
2333
|
+
["QUERY_MORE_END", QueryMoreEndLine],
|
|
2334
|
+
["QUERY_MORE_ITERATIONS", QueryMoreIterationsLine],
|
|
2335
|
+
["TOTAL_EMAIL_RECIPIENTS_QUEUED", TotalEmailRecipientsQueuedLine],
|
|
2336
|
+
["SAVEPOINT_ROLLBACK", SavepointRollbackLine],
|
|
2337
|
+
["SAVEPOINT_SET", SavePointSetLine],
|
|
2338
|
+
["STACK_FRAME_VARIABLE_LIST", StackFrameVariableListLine],
|
|
2339
|
+
["STATIC_VARIABLE_LIST", StaticVariableListLine],
|
|
2340
|
+
["SYSTEM_MODE_ENTER", SystemModeEnterLine],
|
|
2341
|
+
["SYSTEM_MODE_EXIT", SystemModeExitLine],
|
|
2342
|
+
["EXECUTION_STARTED", ExecutionStartedLine],
|
|
2343
|
+
["ENTERING_MANAGED_PKG", EnteringManagedPackageLine],
|
|
2344
|
+
["EVENT_SERVICE_PUB_BEGIN", EventSericePubBeginLine],
|
|
2345
|
+
["EVENT_SERVICE_PUB_END", EventSericePubEndLine],
|
|
2346
|
+
["EVENT_SERVICE_PUB_DETAIL", EventSericePubDetailLine],
|
|
2347
|
+
["EVENT_SERVICE_SUB_BEGIN", EventSericeSubBeginLine],
|
|
2348
|
+
["EVENT_SERVICE_SUB_DETAIL", EventSericeSubDetailLine],
|
|
2349
|
+
["EVENT_SERVICE_SUB_END", EventSericeSubEndLine],
|
|
2350
|
+
["FLOW_START_INTERVIEWS_BEGIN", FlowStartInterviewsBeginLine],
|
|
2351
|
+
["FLOW_START_INTERVIEWS_ERROR", FlowStartInterviewsErrorLine],
|
|
2352
|
+
["FLOW_START_INTERVIEW_BEGIN", FlowStartInterviewBeginLine],
|
|
2353
|
+
["FLOW_START_INTERVIEW_LIMIT_USAGE", FlowStartInterviewLimitUsageLine],
|
|
2354
|
+
["FLOW_START_SCHEDULED_RECORDS", FlowStartScheduledRecordsLine],
|
|
2355
|
+
["FLOW_CREATE_INTERVIEW_ERROR", FlowCreateInterviewErrorLine],
|
|
2356
|
+
["FLOW_ELEMENT_BEGIN", FlowElementBeginLine],
|
|
2357
|
+
["FLOW_ELEMENT_DEFERRED", FlowElementDeferredLine],
|
|
2358
|
+
["FLOW_ELEMENT_ERROR", FlowElementErrorLine],
|
|
2359
|
+
["FLOW_ELEMENT_FAULT", FlowElementFaultLine],
|
|
2360
|
+
["FLOW_ELEMENT_LIMIT_USAGE", FlowElementLimitUsageLine],
|
|
2361
|
+
[
|
|
2362
|
+
"FLOW_INTERVIEW_FINISHED_LIMIT_USAGE",
|
|
2363
|
+
FlowInterviewFinishedLimitUsageLine,
|
|
2364
|
+
],
|
|
2365
|
+
["FLOW_SUBFLOW_DETAIL", FlowSubflowDetailLine],
|
|
2366
|
+
["FLOW_VALUE_ASSIGNMENT", FlowElementAssignmentLine],
|
|
2367
|
+
["FLOW_WAIT_EVENT_RESUMING_DETAIL", FlowWaitEventResumingDetailLine],
|
|
2368
|
+
["FLOW_WAIT_EVENT_WAITING_DETAIL", FlowWaitEventWaitingDetailLine],
|
|
2369
|
+
["FLOW_WAIT_RESUMING_DETAIL", FlowWaitResumingDetailLine],
|
|
2370
|
+
["FLOW_WAIT_WAITING_DETAIL", FlowWaitWaitingDetailLine],
|
|
2371
|
+
["FLOW_INTERVIEW_FINISHED", FlowInterviewFinishedLine],
|
|
2372
|
+
["FLOW_INTERVIEW_PAUSED", FlowInterviewPausedLine],
|
|
2373
|
+
["FLOW_INTERVIEW_RESUMED", FlowInterviewResumedLine],
|
|
2374
|
+
["FLOW_ACTIONCALL_DETAIL", FlowActionCallDetailLine],
|
|
2375
|
+
["FLOW_ASSIGNMENT_DETAIL", FlowAssignmentDetailLine],
|
|
2376
|
+
["FLOW_LOOP_DETAIL", FlowLoopDetailLine],
|
|
2377
|
+
["FLOW_RULE_DETAIL", FlowRuleDetailLine],
|
|
2378
|
+
["FLOW_BULK_ELEMENT_BEGIN", FlowBulkElementBeginLine],
|
|
2379
|
+
["FLOW_BULK_ELEMENT_DETAIL", FlowBulkElementDetailLine],
|
|
2380
|
+
["FLOW_BULK_ELEMENT_LIMIT_USAGE", FlowBulkElementLimitUsageLine],
|
|
2381
|
+
["FLOW_BULK_ELEMENT_NOT_SUPPORTED", FlowBulkElementNotSupportedLine],
|
|
2382
|
+
["MATCH_ENGINE_BEGIN", MatchEngineBegin],
|
|
2383
|
+
["ORG_CACHE_PUT_BEGIN", OrgCachePutBegin],
|
|
2384
|
+
["ORG_CACHE_GET_BEGIN", OrgCacheGetBegin],
|
|
2385
|
+
["ORG_CACHE_REMOVE_BEGIN", OrgCacheRemoveBegin],
|
|
2386
|
+
["PUSH_NOTIFICATION_INVALID_APP", PNInvalidAppLine],
|
|
2387
|
+
["PUSH_NOTIFICATION_INVALID_CERTIFICATE", PNInvalidCertificateLine],
|
|
2388
|
+
["PUSH_NOTIFICATION_INVALID_NOTIFICATION", PNInvalidNotificationLine],
|
|
2389
|
+
["PUSH_NOTIFICATION_NO_DEVICES", PNNoDevicesLine],
|
|
2390
|
+
["PUSH_NOTIFICATION_SENT", PNSentLine],
|
|
2391
|
+
["SESSION_CACHE_PUT_BEGIN", SessionCachePutBegin],
|
|
2392
|
+
["SESSION_CACHE_GET_BEGIN", SessionCacheGetBegin],
|
|
2393
|
+
["SESSION_CACHE_REMOVE_BEGIN", SessionCacheRemoveBegin],
|
|
2394
|
+
["SLA_END", SLAEndLine],
|
|
2395
|
+
["SLA_EVAL_MILESTONE", SLAEvalMilestoneLine],
|
|
2396
|
+
["SLA_PROCESS_CASE", SLAProcessCaseLine],
|
|
2397
|
+
["TESTING_LIMITS", TestingLimitsLine],
|
|
2398
|
+
["VALIDATION_ERROR", ValidationErrorLine],
|
|
2399
|
+
["VALIDATION_FORMULA", ValidationFormulaLine],
|
|
2400
|
+
["VALIDATION_PASS", ValidationPassLine],
|
|
2401
|
+
["VALIDATION_RULE", ValidationRuleLine],
|
|
2402
|
+
["WF_FLOW_ACTION_ERROR", WFFlowActionErrorLine],
|
|
2403
|
+
["WF_FLOW_ACTION_ERROR_DETAIL", WFFlowActionErrorDetailLine],
|
|
2404
|
+
["WF_FIELD_UPDATE", WFFieldUpdateLine],
|
|
2405
|
+
["WF_RULE_EVAL_BEGIN", WFRuleEvalBeginLine],
|
|
2406
|
+
["WF_RULE_EVAL_VALUE", WFRuleEvalValueLine],
|
|
2407
|
+
["WF_RULE_FILTER", WFRuleFilterLine],
|
|
2408
|
+
["WF_CRITERIA_BEGIN", WFCriteriaBeginLine],
|
|
2409
|
+
["WF_FORMULA", WFFormulaLine],
|
|
2410
|
+
["WF_ACTION", WFActionLine],
|
|
2411
|
+
["WF_ACTIONS_END", WFActionsEndLine],
|
|
2412
|
+
["WF_ACTION_TASK", WFActionTaskLine],
|
|
2413
|
+
["WF_APPROVAL", WFApprovalLine],
|
|
2414
|
+
["WF_APPROVAL_REMOVE", WFApprovalRemoveLine],
|
|
2415
|
+
["WF_APPROVAL_SUBMIT", WFApprovalSubmitLine],
|
|
2416
|
+
["WF_APPROVAL_SUBMITTER", WFApprovalSubmitterLine],
|
|
2417
|
+
["WF_ASSIGN", WFAssignLine],
|
|
2418
|
+
["WF_EMAIL_ALERT", WFEmailAlertLine],
|
|
2419
|
+
["WF_EMAIL_SENT", WFEmailSentLine],
|
|
2420
|
+
["WF_ENQUEUE_ACTIONS", WFEnqueueActionsLine],
|
|
2421
|
+
["WF_ESCALATION_ACTION", WFEscalationActionLine],
|
|
2422
|
+
["WF_EVAL_ENTRY_CRITERIA", WFEvalEntryCriteriaLine],
|
|
2423
|
+
["WF_FLOW_ACTION_DETAIL", WFFlowActionDetailLine],
|
|
2424
|
+
["WF_NEXT_APPROVER", WFNextApproverLine],
|
|
2425
|
+
["WF_OUTBOUND_MSG", WFOutboundMsgLine],
|
|
2426
|
+
["WF_PROCESS_FOUND", WFProcessFoundLine],
|
|
2427
|
+
["WF_PROCESS_NODE", WFProcessNode],
|
|
2428
|
+
["WF_REASSIGN_RECORD", WFReassignRecordLine],
|
|
2429
|
+
["WF_RESPONSE_NOTIFY", WFResponseNotifyLine],
|
|
2430
|
+
["WF_RULE_ENTRY_ORDER", WFRuleEntryOrderLine],
|
|
2431
|
+
["WF_RULE_INVOCATION", WFRuleInvocationLine],
|
|
2432
|
+
["WF_SOFT_REJECT", WFSoftRejectLine],
|
|
2433
|
+
["WF_SPOOL_ACTION_BEGIN", WFSpoolActionBeginLine],
|
|
2434
|
+
["WF_TIME_TRIGGER", WFTimeTriggerLine],
|
|
2435
|
+
["EXCEPTION_THROWN", ExceptionThrownLine],
|
|
2436
|
+
["FATAL_ERROR", FatalErrorLine],
|
|
2437
|
+
["XDS_DETAIL", XDSDetailLine],
|
|
2438
|
+
["XDS_RESPONSE", XDSResponseLine],
|
|
2439
|
+
["XDS_RESPONSE_DETAIL", XDSResponseDetailLine],
|
|
2440
|
+
["XDS_RESPONSE_ERROR", XDSResponseErrorLine],
|
|
2441
|
+
["DUPLICATE_DETECTION_BEGIN", DuplicateDetectionBegin],
|
|
2442
|
+
["DUPLICATE_DETECTION_RULE_INVOCATION", DuplicateDetectionRule],
|
|
2443
|
+
["DUPLICATE_DETECTION_MATCH_INVOCATION_DETAILS", DuplicateDetectionDetails],
|
|
2444
|
+
["DUPLICATE_DETECTION_MATCH_INVOCATION_SUMMARY", DuplicateDetectionSummary],
|
|
2445
|
+
]);
|
|
2446
|
+
const basicLogEvents = [
|
|
2447
|
+
"BULK_COUNTABLE_STATEMENT_EXECUTE",
|
|
2448
|
+
"TEMPLATE_PROCESSING_ERROR",
|
|
2449
|
+
"EXTERNAL_SERVICE_REQUEST",
|
|
2450
|
+
"FLOW_CREATE_INTERVIEW_BEGIN",
|
|
2451
|
+
"FLOW_CREATE_INTERVIEW_END",
|
|
2452
|
+
"VARIABLE_SCOPE_END",
|
|
2453
|
+
"PUSH_NOTIFICATION_NOT_ENABLED",
|
|
2454
|
+
"SLA_NULL_START_DATE",
|
|
2455
|
+
"TEMPLATE_PROCESSING_ERROR",
|
|
2456
|
+
"VALIDATION_FAIL",
|
|
2457
|
+
`WF_FLOW_ACTION_BEGIN`,
|
|
2458
|
+
"WF_FLOW_ACTION_END",
|
|
2459
|
+
"WF_ESCALATION_RULE",
|
|
2460
|
+
"WF_HARD_REJECT",
|
|
2461
|
+
"WF_NO_PROCESS_FOUND",
|
|
2462
|
+
"WF_TIME_TRIGGERS_BEGIN",
|
|
2463
|
+
"WF_KNOWLEDGE_ACTION",
|
|
2464
|
+
"WF_SEND_ACTION",
|
|
2465
|
+
"WAVE_APP_LIFECYCLE",
|
|
2466
|
+
"WF_QUICK_CREATE",
|
|
2467
|
+
"WF_APEX_ACTION",
|
|
2468
|
+
"INVOCABLE_ACTION_DETAIL",
|
|
2469
|
+
"INVOCABLE_ACTION_ERROR",
|
|
2470
|
+
"FLOW_COLLECTION_PROCESSOR_DETAIL",
|
|
2471
|
+
"FLOW_SCHEDULED_PATH_QUEUED",
|
|
2472
|
+
"ROUTE_WORK_ACTION",
|
|
2473
|
+
"ADD_SKILL_REQUIREMENT_ACTION",
|
|
2474
|
+
"ADD_SCREEN_POP_ACTION",
|
|
2475
|
+
"CALLOUT_REQUEST_PREPARE",
|
|
2476
|
+
"CALLOUT_REQUEST_FINALIZE",
|
|
2477
|
+
"FUNCTION_INVOCATION_REQUEST",
|
|
2478
|
+
"APP_CONTAINER_INITIATED",
|
|
2479
|
+
"FUNCTION_INVOCATION_RESPONSE",
|
|
2480
|
+
"XDS_REQUEST_DETAIL",
|
|
2481
|
+
"EXTERNAL_SERVICE_RESPONSE",
|
|
2482
|
+
"DATAWEAVE_USER_DEBUG",
|
|
2483
|
+
"USER_DEBUG_FINER",
|
|
2484
|
+
"USER_DEBUG_FINEST",
|
|
2485
|
+
"USER_DEBUG_FINE",
|
|
2486
|
+
"USER_DEBUG_DEBUG",
|
|
2487
|
+
"USER_DEBUG_INFO",
|
|
2488
|
+
"USER_DEBUG_WARN",
|
|
2489
|
+
"USER_DEBUG_ERROR",
|
|
2490
|
+
"VF_APEX_CALL",
|
|
2491
|
+
"HEAP_DUMP",
|
|
2492
|
+
"SCRIPT_EXECUTION",
|
|
2493
|
+
"SESSION_CACHE_MEMORY_USAGE",
|
|
2494
|
+
"ORG_CACHE_MEMORY_USAGE",
|
|
2495
|
+
"AE_PERSIST_VALIDATION",
|
|
2496
|
+
"REFERENCED_OBJECT_LIST",
|
|
2497
|
+
"DUPLICATE_RULE_FILTER",
|
|
2498
|
+
"DUPLICATE_RULE_FILTER_RESULT",
|
|
2499
|
+
"DUPLICATE_RULE_FILTER_VALUE",
|
|
2500
|
+
"TEMPLATED_ASSET",
|
|
2501
|
+
"TRANSFORMATION_SUMMARY",
|
|
2502
|
+
"RULES_EXECUTION_SUMMARY",
|
|
2503
|
+
"ASSET_DIFF_SUMMARY",
|
|
2504
|
+
"ASSET_DIFF_DETAIL",
|
|
2505
|
+
"RULES_EXECUTION_DETAIL",
|
|
2506
|
+
"JSON_DIFF_SUMMARY",
|
|
2507
|
+
"JSON_DIFF_DETAIL",
|
|
2508
|
+
"MATCH_ENGINE_INVOCATION",
|
|
2509
|
+
];
|
|
2510
|
+
const basicExitLogEvents = [
|
|
2511
|
+
"FLOW_START_INTERVIEW_END",
|
|
2512
|
+
"VF_DESERIALIZE_VIEWSTATE_END",
|
|
2513
|
+
"VF_SERIALIZE_VIEWSTATE_END",
|
|
2514
|
+
"CUMULATIVE_LIMIT_USAGE_END",
|
|
2515
|
+
"CUMULATIVE_PROFILING_END",
|
|
2516
|
+
"EXECUTION_FINISHED",
|
|
2517
|
+
"FLOW_START_INTERVIEWS_END",
|
|
2518
|
+
"FLOW_ELEMENT_END",
|
|
2519
|
+
"FLOW_BULK_ELEMENT_END",
|
|
2520
|
+
"WF_RULE_EVAL_END",
|
|
2521
|
+
"WF_RULE_NOT_EVALUATED",
|
|
2522
|
+
"WF_CRITERIA_END",
|
|
2523
|
+
"DUPLICATE_DETECTION_END",
|
|
2524
|
+
"VF_SERIALIZE_CONTINUATION_STATE_END",
|
|
2525
|
+
"VF_DESERIALIZE_CONTINUATION_STATE_END",
|
|
2526
|
+
"MATCH_ENGINE_END",
|
|
2527
|
+
"ORG_CACHE_PUT_END",
|
|
2528
|
+
"ORG_CACHE_GET_END",
|
|
2529
|
+
"ORG_CACHE_REMOVE_END",
|
|
2530
|
+
"SESSION_CACHE_PUT_END",
|
|
2531
|
+
"SESSION_CACHE_GET_END",
|
|
2532
|
+
"SESSION_CACHE_REMOVE_END",
|
|
2533
|
+
];
|
|
2534
|
+
const _logEventNames = [
|
|
2535
|
+
"BULK_DML_RETRY",
|
|
2536
|
+
"BULK_HEAP_ALLOCATE",
|
|
2537
|
+
"CALLOUT_REQUEST",
|
|
2538
|
+
"CALLOUT_RESPONSE",
|
|
2539
|
+
"NAMED_CREDENTIAL_REQUEST",
|
|
2540
|
+
"NAMED_CREDENTIAL_RESPONSE",
|
|
2541
|
+
"NAMED_CREDENTIAL_RESPONSE_DETAIL",
|
|
2542
|
+
"CONSTRUCTOR_ENTRY",
|
|
2543
|
+
"CONSTRUCTOR_EXIT",
|
|
2544
|
+
"EMAIL_QUEUE",
|
|
2545
|
+
"METHOD_ENTRY",
|
|
2546
|
+
"METHOD_EXIT",
|
|
2547
|
+
"SYSTEM_CONSTRUCTOR_ENTRY",
|
|
2548
|
+
"SYSTEM_CONSTRUCTOR_EXIT",
|
|
2549
|
+
"SYSTEM_METHOD_ENTRY",
|
|
2550
|
+
"SYSTEM_METHOD_EXIT",
|
|
2551
|
+
"CODE_UNIT_STARTED",
|
|
2552
|
+
"CODE_UNIT_FINISHED",
|
|
2553
|
+
"VF_APEX_CALL_START",
|
|
2554
|
+
"VF_APEX_CALL_END",
|
|
2555
|
+
"VF_DESERIALIZE_VIEWSTATE_BEGIN",
|
|
2556
|
+
"VF_EVALUATE_FORMULA_BEGIN",
|
|
2557
|
+
"VF_EVALUATE_FORMULA_END",
|
|
2558
|
+
"VF_SERIALIZE_CONTINUATION_STATE_BEGIN",
|
|
2559
|
+
"VF_DESERIALIZE_CONTINUATION_STATE_BEGIN",
|
|
2560
|
+
"VF_SERIALIZE_VIEWSTATE_BEGIN",
|
|
2561
|
+
"VF_PAGE_MESSAGE",
|
|
2562
|
+
"DML_BEGIN",
|
|
2563
|
+
"DML_END",
|
|
2564
|
+
"IDEAS_QUERY_EXECUTE",
|
|
2565
|
+
"SOQL_EXECUTE_BEGIN",
|
|
2566
|
+
"SOQL_EXECUTE_END",
|
|
2567
|
+
"SOQL_EXECUTE_EXPLAIN",
|
|
2568
|
+
"SOSL_EXECUTE_BEGIN",
|
|
2569
|
+
"SOSL_EXECUTE_END",
|
|
2570
|
+
"HEAP_ALLOCATE",
|
|
2571
|
+
"HEAP_DEALLOCATE",
|
|
2572
|
+
"STATEMENT_EXECUTE",
|
|
2573
|
+
"VARIABLE_SCOPE_BEGIN",
|
|
2574
|
+
"VARIABLE_ASSIGNMENT",
|
|
2575
|
+
"USER_INFO",
|
|
2576
|
+
"USER_DEBUG",
|
|
2577
|
+
"CUMULATIVE_LIMIT_USAGE",
|
|
2578
|
+
"CUMULATIVE_PROFILING",
|
|
2579
|
+
"CUMULATIVE_PROFILING_BEGIN",
|
|
2580
|
+
"LIMIT_USAGE",
|
|
2581
|
+
"LIMIT_USAGE_FOR_NS",
|
|
2582
|
+
"NBA_NODE_BEGIN",
|
|
2583
|
+
"NBA_NODE_DETAIL",
|
|
2584
|
+
"NBA_NODE_END",
|
|
2585
|
+
"NBA_NODE_ERROR",
|
|
2586
|
+
"NBA_OFFER_INVALID",
|
|
2587
|
+
"NBA_STRATEGY_BEGIN",
|
|
2588
|
+
"NBA_STRATEGY_END",
|
|
2589
|
+
"NBA_STRATEGY_ERROR",
|
|
2590
|
+
"POP_TRACE_FLAGS",
|
|
2591
|
+
"PUSH_TRACE_FLAGS",
|
|
2592
|
+
"QUERY_MORE_BEGIN",
|
|
2593
|
+
"QUERY_MORE_END",
|
|
2594
|
+
"QUERY_MORE_ITERATIONS",
|
|
2595
|
+
"TOTAL_EMAIL_RECIPIENTS_QUEUED",
|
|
2596
|
+
"SAVEPOINT_ROLLBACK",
|
|
2597
|
+
"SAVEPOINT_SET",
|
|
2598
|
+
"STACK_FRAME_VARIABLE_LIST",
|
|
2599
|
+
"STATIC_VARIABLE_LIST",
|
|
2600
|
+
"SYSTEM_MODE_ENTER",
|
|
2601
|
+
"SYSTEM_MODE_EXIT",
|
|
2602
|
+
"EXECUTION_STARTED",
|
|
2603
|
+
"ENTERING_MANAGED_PKG",
|
|
2604
|
+
"EVENT_SERVICE_PUB_BEGIN",
|
|
2605
|
+
"EVENT_SERVICE_PUB_END",
|
|
2606
|
+
"EVENT_SERVICE_PUB_DETAIL",
|
|
2607
|
+
"EVENT_SERVICE_SUB_BEGIN",
|
|
2608
|
+
"EVENT_SERVICE_SUB_DETAIL",
|
|
2609
|
+
"EVENT_SERVICE_SUB_END",
|
|
2610
|
+
"FLOW_START_INTERVIEWS_BEGIN",
|
|
2611
|
+
"FLOW_START_INTERVIEWS_ERROR",
|
|
2612
|
+
"FLOW_START_INTERVIEW_BEGIN",
|
|
2613
|
+
"FLOW_START_INTERVIEW_LIMIT_USAGE",
|
|
2614
|
+
"FLOW_START_SCHEDULED_RECORDS",
|
|
2615
|
+
"FLOW_CREATE_INTERVIEW_ERROR",
|
|
2616
|
+
"FLOW_ELEMENT_BEGIN",
|
|
2617
|
+
"FLOW_ELEMENT_DEFERRED",
|
|
2618
|
+
"FLOW_ELEMENT_ERROR",
|
|
2619
|
+
"FLOW_ELEMENT_FAULT",
|
|
2620
|
+
"FLOW_ELEMENT_LIMIT_USAGE",
|
|
2621
|
+
"FLOW_INTERVIEW_FINISHED_LIMIT_USAGE",
|
|
2622
|
+
"FLOW_SUBFLOW_DETAIL",
|
|
2623
|
+
"FLOW_VALUE_ASSIGNMENT",
|
|
2624
|
+
"FLOW_WAIT_EVENT_RESUMING_DETAIL",
|
|
2625
|
+
"FLOW_WAIT_EVENT_WAITING_DETAIL",
|
|
2626
|
+
"FLOW_WAIT_RESUMING_DETAIL",
|
|
2627
|
+
"FLOW_WAIT_WAITING_DETAIL",
|
|
2628
|
+
"FLOW_INTERVIEW_FINISHED",
|
|
2629
|
+
"FLOW_INTERVIEW_PAUSED",
|
|
2630
|
+
"FLOW_INTERVIEW_RESUMED",
|
|
2631
|
+
"FLOW_ACTIONCALL_DETAIL",
|
|
2632
|
+
"FLOW_ASSIGNMENT_DETAIL",
|
|
2633
|
+
"FLOW_LOOP_DETAIL",
|
|
2634
|
+
"FLOW_RULE_DETAIL",
|
|
2635
|
+
"FLOW_BULK_ELEMENT_BEGIN",
|
|
2636
|
+
"FLOW_BULK_ELEMENT_DETAIL",
|
|
2637
|
+
"FLOW_BULK_ELEMENT_LIMIT_USAGE",
|
|
2638
|
+
"FLOW_BULK_ELEMENT_NOT_SUPPORTED",
|
|
2639
|
+
"MATCH_ENGINE_BEGIN",
|
|
2640
|
+
"ORG_CACHE_PUT_BEGIN",
|
|
2641
|
+
"ORG_CACHE_GET_BEGIN",
|
|
2642
|
+
"ORG_CACHE_REMOVE_BEGIN",
|
|
2643
|
+
"PUSH_NOTIFICATION_INVALID_APP",
|
|
2644
|
+
"PUSH_NOTIFICATION_INVALID_CERTIFICATE",
|
|
2645
|
+
"PUSH_NOTIFICATION_INVALID_NOTIFICATION",
|
|
2646
|
+
"PUSH_NOTIFICATION_NO_DEVICES",
|
|
2647
|
+
"PUSH_NOTIFICATION_SENT",
|
|
2648
|
+
"SESSION_CACHE_PUT_BEGIN",
|
|
2649
|
+
"SESSION_CACHE_GET_BEGIN",
|
|
2650
|
+
"SESSION_CACHE_REMOVE_BEGIN",
|
|
2651
|
+
"SLA_END",
|
|
2652
|
+
"SLA_EVAL_MILESTONE",
|
|
2653
|
+
"SLA_PROCESS_CASE",
|
|
2654
|
+
"TESTING_LIMITS",
|
|
2655
|
+
"VALIDATION_ERROR",
|
|
2656
|
+
"VALIDATION_FORMULA",
|
|
2657
|
+
"VALIDATION_PASS",
|
|
2658
|
+
"VALIDATION_RULE",
|
|
2659
|
+
"WF_FLOW_ACTION_ERROR",
|
|
2660
|
+
"WF_FLOW_ACTION_ERROR_DETAIL",
|
|
2661
|
+
"WF_FIELD_UPDATE",
|
|
2662
|
+
"WF_RULE_EVAL_BEGIN",
|
|
2663
|
+
"WF_RULE_EVAL_VALUE",
|
|
2664
|
+
"WF_RULE_FILTER",
|
|
2665
|
+
"WF_CRITERIA_BEGIN",
|
|
2666
|
+
"WF_FORMULA",
|
|
2667
|
+
"WF_ACTION",
|
|
2668
|
+
"WF_ACTIONS_END",
|
|
2669
|
+
"WF_ACTION_TASK",
|
|
2670
|
+
"WF_APPROVAL",
|
|
2671
|
+
"WF_APPROVAL_REMOVE",
|
|
2672
|
+
"WF_APPROVAL_SUBMIT",
|
|
2673
|
+
"WF_APPROVAL_SUBMITTER",
|
|
2674
|
+
"WF_ASSIGN",
|
|
2675
|
+
"WF_EMAIL_ALERT",
|
|
2676
|
+
"WF_EMAIL_SENT",
|
|
2677
|
+
"WF_ENQUEUE_ACTIONS",
|
|
2678
|
+
"WF_ESCALATION_ACTION",
|
|
2679
|
+
"WF_EVAL_ENTRY_CRITERIA",
|
|
2680
|
+
"WF_FLOW_ACTION_DETAIL",
|
|
2681
|
+
"WF_NEXT_APPROVER",
|
|
2682
|
+
"WF_OUTBOUND_MSG",
|
|
2683
|
+
"WF_PROCESS_FOUND",
|
|
2684
|
+
"WF_PROCESS_NODE",
|
|
2685
|
+
"WF_REASSIGN_RECORD",
|
|
2686
|
+
"WF_RESPONSE_NOTIFY",
|
|
2687
|
+
"WF_RULE_ENTRY_ORDER",
|
|
2688
|
+
"WF_RULE_INVOCATION",
|
|
2689
|
+
"WF_SOFT_REJECT",
|
|
2690
|
+
"WF_SPOOL_ACTION_BEGIN",
|
|
2691
|
+
"WF_TIME_TRIGGER",
|
|
2692
|
+
"EXCEPTION_THROWN",
|
|
2693
|
+
"FATAL_ERROR",
|
|
2694
|
+
"XDS_DETAIL",
|
|
2695
|
+
"XDS_RESPONSE",
|
|
2696
|
+
"XDS_RESPONSE_DETAIL",
|
|
2697
|
+
"XDS_RESPONSE_ERROR",
|
|
2698
|
+
"DUPLICATE_DETECTION_BEGIN",
|
|
2699
|
+
"DUPLICATE_DETECTION_RULE_INVOCATION",
|
|
2700
|
+
"DUPLICATE_DETECTION_MATCH_INVOCATION_DETAILS",
|
|
2701
|
+
"DUPLICATE_DETECTION_MATCH_INVOCATION_SUMMARY",
|
|
2702
|
+
"BULK_COUNTABLE_STATEMENT_EXECUTE",
|
|
2703
|
+
"TEMPLATE_PROCESSING_ERROR",
|
|
2704
|
+
"EXTERNAL_SERVICE_REQUEST",
|
|
2705
|
+
"FLOW_START_INTERVIEW_END",
|
|
2706
|
+
"FLOW_CREATE_INTERVIEW_BEGIN",
|
|
2707
|
+
"FLOW_CREATE_INTERVIEW_END",
|
|
2708
|
+
"VARIABLE_SCOPE_END",
|
|
2709
|
+
"PUSH_NOTIFICATION_NOT_ENABLED",
|
|
2710
|
+
"SLA_NULL_START_DATE",
|
|
2711
|
+
"TEMPLATE_PROCESSING_ERROR",
|
|
2712
|
+
"VALIDATION_FAIL",
|
|
2713
|
+
`WF_FLOW_ACTION_BEGIN`,
|
|
2714
|
+
"WF_FLOW_ACTION_END",
|
|
2715
|
+
"WF_ESCALATION_RULE",
|
|
2716
|
+
"WF_HARD_REJECT",
|
|
2717
|
+
"WF_NO_PROCESS_FOUND",
|
|
2718
|
+
"WF_TIME_TRIGGERS_BEGIN",
|
|
2719
|
+
"WF_KNOWLEDGE_ACTION",
|
|
2720
|
+
"WF_SEND_ACTION",
|
|
2721
|
+
"WAVE_APP_LIFECYCLE",
|
|
2722
|
+
"WF_QUICK_CREATE",
|
|
2723
|
+
"WF_APEX_ACTION",
|
|
2724
|
+
"INVOCABLE_ACTION_DETAIL",
|
|
2725
|
+
"INVOCABLE_ACTION_ERROR",
|
|
2726
|
+
"FLOW_COLLECTION_PROCESSOR_DETAIL",
|
|
2727
|
+
"FLOW_SCHEDULED_PATH_QUEUED",
|
|
2728
|
+
"ROUTE_WORK_ACTION",
|
|
2729
|
+
"ADD_SKILL_REQUIREMENT_ACTION",
|
|
2730
|
+
"ADD_SCREEN_POP_ACTION",
|
|
2731
|
+
"CALLOUT_REQUEST_PREPARE",
|
|
2732
|
+
"CALLOUT_REQUEST_FINALIZE",
|
|
2733
|
+
"FUNCTION_INVOCATION_REQUEST",
|
|
2734
|
+
"APP_CONTAINER_INITIATED",
|
|
2735
|
+
"FUNCTION_INVOCATION_RESPONSE",
|
|
2736
|
+
"XDS_REQUEST_DETAIL",
|
|
2737
|
+
"EXTERNAL_SERVICE_RESPONSE",
|
|
2738
|
+
"DATAWEAVE_USER_DEBUG",
|
|
2739
|
+
"USER_DEBUG_FINER",
|
|
2740
|
+
"USER_DEBUG_FINEST",
|
|
2741
|
+
"USER_DEBUG_FINE",
|
|
2742
|
+
"USER_DEBUG_DEBUG",
|
|
2743
|
+
"USER_DEBUG_INFO",
|
|
2744
|
+
"USER_DEBUG_WARN",
|
|
2745
|
+
"USER_DEBUG_ERROR",
|
|
2746
|
+
"VF_APEX_CALL",
|
|
2747
|
+
"HEAP_DUMP",
|
|
2748
|
+
"SCRIPT_EXECUTION",
|
|
2749
|
+
"SESSION_CACHE_MEMORY_USAGE",
|
|
2750
|
+
"ORG_CACHE_MEMORY_USAGE",
|
|
2751
|
+
"AE_PERSIST_VALIDATION",
|
|
2752
|
+
"REFERENCED_OBJECT_LIST",
|
|
2753
|
+
"DUPLICATE_RULE_FILTER",
|
|
2754
|
+
"DUPLICATE_RULE_FILTER_RESULT",
|
|
2755
|
+
"DUPLICATE_RULE_FILTER_VALUE",
|
|
2756
|
+
"TEMPLATED_ASSET",
|
|
2757
|
+
"TRANSFORMATION_SUMMARY",
|
|
2758
|
+
"RULES_EXECUTION_SUMMARY",
|
|
2759
|
+
"ASSET_DIFF_SUMMARY",
|
|
2760
|
+
"ASSET_DIFF_DETAIL",
|
|
2761
|
+
"RULES_EXECUTION_DETAIL",
|
|
2762
|
+
"JSON_DIFF_SUMMARY",
|
|
2763
|
+
"JSON_DIFF_DETAIL",
|
|
2764
|
+
"MATCH_ENGINE_INVOCATION",
|
|
2765
|
+
"VF_DESERIALIZE_VIEWSTATE_END",
|
|
2766
|
+
"VF_SERIALIZE_VIEWSTATE_END",
|
|
2767
|
+
"CUMULATIVE_LIMIT_USAGE_END",
|
|
2768
|
+
"CUMULATIVE_PROFILING_END",
|
|
2769
|
+
"EXECUTION_FINISHED",
|
|
2770
|
+
"FLOW_START_INTERVIEWS_END",
|
|
2771
|
+
"FLOW_ELEMENT_END",
|
|
2772
|
+
"FLOW_BULK_ELEMENT_END",
|
|
2773
|
+
"WF_RULE_EVAL_END",
|
|
2774
|
+
"WF_RULE_NOT_EVALUATED",
|
|
2775
|
+
"WF_CRITERIA_END",
|
|
2776
|
+
"DUPLICATE_DETECTION_END",
|
|
2777
|
+
"VF_SERIALIZE_CONTINUATION_STATE_END",
|
|
2778
|
+
"VF_DESERIALIZE_CONTINUATION_STATE_END",
|
|
2779
|
+
"MATCH_ENGINE_END",
|
|
2780
|
+
"ORG_CACHE_PUT_END",
|
|
2781
|
+
"ORG_CACHE_GET_END",
|
|
2782
|
+
"ORG_CACHE_REMOVE_END",
|
|
2783
|
+
"SESSION_CACHE_PUT_END",
|
|
2784
|
+
"SESSION_CACHE_GET_END",
|
|
2785
|
+
"SESSION_CACHE_REMOVE_END",
|
|
2786
|
+
];
|
|
2787
|
+
export { DMLBeginLine, SOQLExecuteBeginLine, SOQLExecuteExplainLine };
|
|
2788
|
+
//# sourceMappingURL=ApexLogParser.js.map
|