Debug Apex
Use Glade for local breakpoints and profile reports. Use Salesforce logs when the behavior depends on hosted services.
Before you start
Run from the project root. Create a reports directory if you plan to save log or profile output. Open VS Code when you want breakpoints through the debug adapter.
Steps
Start the debug adapter:
glade dap --project .Profile an anonymous Apex log as Markdown:
glade debug profile --log reports/anonymous-output.txt --format markdownWrite the same profile as JSON:
glade debug profile --log reports/anonymous-output.txt --jsonCapture a local native trace and convert it to pprof:
glade exec --project . --trace reports/trace.json "System.debug(1);"
glade profile analyze reports/trace.json --format pprofExpected output
The debug adapter waits for an editor session. Profile commands print method timing, call counts, and source locations when the log or native trace contains the needed events. JSON and pprof modes are for tools.
Common wrong turn
Do not profile a hosted-only failure from a local trace and call it complete. Local traces show supported local execution. Hosted integrations still need a Salesforce log.