Skip to content

Commit 9898738

Browse files
committed
Merge branch 'main' into chore-ms-time-display
2 parents 45feb9c + 5cbfda3 commit 9898738

99 files changed

Lines changed: 5850 additions & 3068 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ node_modules
77
dist/
88
build/
99
out/
10+
coverage/

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6666
- Markers for errors, skipped lines, and truncation
6767
- Click to navigate to Call Tree (now on key press of `J` or `Cmd/Ctrl+Click`)
6868
- **Legacy Support**: Toggle the legacy timeline anytime via **Settings -> Apex Log Analyzer -> Timeline -> Legacy**.
69+
- 📄 **Raw Log Navigation**: Seamless navigation between raw log files and the log analysis. ([#204])
70+
- **Show in Raw Log**: Right-click timeline or call tree frames → "Show in Log File" to jump to the corresponding line.
71+
- **Show in Log Analysis**: Click the hover link on raw log lines to navigate back to the log analysis.
72+
- **Code Folding**: Collapse/expand matching start/end events (METHOD_ENTRY/EXIT, CODE_UNIT, DML, SOQL, etc.).
73+
- **Line Decorations**: Duration appears as ghost text at the end of the cursor line (e.g., `1.23s (self: 45ms)`).
74+
- **Hover Details**: Hover near the ghost text to see SOQL/DML counts, row counts, and exception info.
75+
- **Total Duration**: First line shows total log execution time.
6976

7077
### Changed
7178

@@ -466,6 +473,7 @@ Skipped due to adopting odd numbering for pre releases and even number for relea
466473

467474
<!-- Unreleased -->
468475

476+
[#204]: https://github.com/certinia/debug-log-analyzer/issues/204
469477
[#714]: https://github.com/certinia/debug-log-analyzer/issues/714
470478
[#245]: https://github.com/certinia/debug-log-analyzer/issues/245
471479
[#164]: https://github.com/certinia/debug-log-analyzer/issues/164

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Apex Log Analyzer is a blazing-fast VS Code extension for Salesforce developers.
2323
- **🔥 [Timeline](#-timeline)** – Visualize every method, SOQL query, and DML operation in your Apex logs with an interactive flame chart and minimap navigation.
2424
- **🌲 [Interactive Call Tree](#-call-tree)** – Dive into execution stacks with timing, row counts, and DML/ SOQL metrics.
2525
- **📊 [Apex](#-apex-analysis) + [Database](#%EF%B8%8F-database-analysis) Analysis** – Identify slow-performing SOQL, high-impact DML, and time-heavy Apex methods.
26+
- **📄 [Raw Log Navigation](#-raw-log-navigation)** – Jump between analysis views and raw log files with code folding, hover details, and bidirectional navigation.
2627
- **🧠 Smart Filtering + Sorting** – Focus on what matters: filter by namespace, event type, or duration.
2728
- **🔍 Deep Search** – Find events across the flame chart, call tree, and database tables.
2829
- **📤 Export + Share** – Copy or Export Salesforce debug log insights for analysis or collaboration.
@@ -150,6 +151,17 @@ Search across all visualizations:
150151

151152
Quickly step through matches, auto-expand parents, and automatically show timeline tooltips.
152153

154+
## 📄 Raw Log Navigation
155+
156+
Seamlessly navigate between the visual analysis and your raw `.log` files:
157+
158+
- **Show in Raw Log** – Right-click any frame in Timeline or Call Tree → "Show in Log File" to jump to the exact line.
159+
- **Show in Log Analysis** – Hover a raw log line to see metrics and click "Show in Log Analysis" to jump back.
160+
- **Code Folding** – Collapse/expand matching start/end events (METHOD_ENTRY/EXIT, DML_BEGIN/END, etc.) using the gutter icons or `Ctrl+Shift+[`/`]`.
161+
- **Line Decorations** – Duration appears as ghost text at the end of the cursor line (e.g., `1.23s (self: 45ms)`).
162+
- **Hover Details** – Hover near the ghost text to see SOQL/DML counts, row counts, and exception info.
163+
- **Total Duration** – First line displays total log execution time.
164+
153165
## 🎨 Customization
154166

155167
Adjust event colors in `settings.json`:

log-viewer/src/__tests__/ApexLogParser.test.ts renamed to apex-log-parser/__tests__/ApexLogParser.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
* Copyright (c) 2020 Certinia Inc. All rights reserved.
33
*/
44
import {
5+
ApexLogParser,
56
CodeUnitStartedLine,
67
ExecutionStartedLine,
8+
lineTypeMap,
79
LogEvent,
810
MethodEntryLine,
9-
SOQLExecuteBeginLine,
10-
SOQLExecuteExplainLine,
11+
parse,
1112
parseObjectNamespace,
1213
parseRows,
1314
parseVfNamespace,
14-
} from '../core/log-parser/LogEvents.js';
15-
import { lineTypeMap } from '../core/log-parser/LogLineMapping.js';
16-
17-
import { ApexLogParser, parse } from '../core/log-parser/ApexLogParser.js';
15+
SOQLExecuteBeginLine,
16+
SOQLExecuteExplainLine,
17+
} from '../src/index.js';
1818

1919
class DummyLine extends LogEvent {
2020
constructor(parser: ApexLogParser, parts: string[]) {

apex-log-parser/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "apex-log-parser",
3+
"version": "0.1.0",
4+
"private": true,
5+
"description": "Apex debug log parser for Salesforce",
6+
"type": "module"
7+
}
File renamed without changes.

log-viewer/src/core/log-parser/LogEvents.ts renamed to apex-log-parser/src/LogEvents.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,17 +425,21 @@ export class BulkHeapAllocateLine extends LogEvent {
425425
}
426426
}
427427

428-
export class CalloutRequestLine extends LogEvent {
428+
export class CalloutRequestLine extends DurationLogEvent {
429429
constructor(parser: ApexLogParser, parts: string[]) {
430-
super(parser, parts);
431-
this.text = `${parts[3]} : ${parts[2]}`;
430+
super(parser, parts, ['CALLOUT_RESPONSE'], 'Method', 'free');
431+
this.text = parts[3] ?? '';
432+
this.lineNumber = this.parseLineNumber(parts[2]);
432433
}
433434
}
434435

435436
export class CalloutResponseLine extends LogEvent {
437+
isExit = true;
438+
436439
constructor(parser: ApexLogParser, parts: string[]) {
437440
super(parser, parts);
438-
this.text = `${parts[3]} : ${parts[2]}`;
441+
this.text = parts[3] ?? '';
442+
this.lineNumber = this.parseLineNumber(parts[2]);
439443
}
440444
}
441445
export class NamedCredentialRequestLine extends LogEvent {
File renamed without changes.

apex-log-parser/src/index.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2020 Certinia Inc. All rights reserved.
3+
*/
4+
5+
// Parser
6+
export { ApexLogParser, DebugLevel, parse } from './ApexLogParser.js';
7+
8+
// Types
9+
export type {
10+
CPUType,
11+
GovernorLimits,
12+
GovernorSnapshot,
13+
IssueType,
14+
Limits,
15+
LineNumber,
16+
LogEventType,
17+
LogIssue,
18+
LogLineConstructor,
19+
LogSubCategory,
20+
SelfTotal,
21+
} from './types.js';
22+
23+
// Events - classes and utilities used by consumers
24+
export {
25+
ApexLog,
26+
CodeUnitStartedLine,
27+
DMLBeginLine,
28+
ExecutionStartedLine,
29+
LogEvent,
30+
MethodEntryLine,
31+
SOQLExecuteBeginLine,
32+
SOQLExecuteExplainLine,
33+
parseObjectNamespace,
34+
parseRows,
35+
parseVfNamespace,
36+
} from './LogEvents.js';
37+
38+
// Mapping
39+
export { getLogEventClass, lineTypeMap } from './LogLineMapping.js';

0 commit comments

Comments
 (0)