Seeing the full information when debugging

25 views
Skip to first unread message

Chris Baker

unread,
Feb 2, 2024, 6:55:58 PMFeb 2
to Illuminated Cloud General Discussion
Hi, I had a question about debugging.

When debugging in IC and I see something like this with the "(16 more)...", is there any way in IC to see the rest of the string? Or is that all that Salesforce provides when debugging?
debug.png

Scott Wells

unread,
Feb 2, 2024, 7:02:33 PMFeb 2
to Illuminated Cloud General Discussion, tchri...@gmail.com
Hi. IC's debugger is a log-based debugger. It's parsing a given Apex log file from a process that's already executed and is organizing the entries into the corresponding execution stack frames, then allowing you to step through that execution. It's therefore limited by the fidelity of the information in the original log, and those logs often truncate variable value information.

While there's no way to get more from the logs themselves (at least not once you're logging above a certain logging level), you can add a server-side checkpoint that will capture a heap dump on a line of code where you'd like to see more information. Note, however, that you're only allowed five active checkpoints per-user, and if the heap dump should occur on other than the first time that line of code is executed, you need to configure the checkpoint iteration count accordingly.

Hopefully that helps. Please let me know if you have additional questions.

Regards,
Scott Wells

Scott Wells

unread,
Feb 2, 2024, 7:39:21 PMFeb 2
to Illuminated Cloud General Discussion, Scott Wells, tchri...@gmail.com
There was a follow-up question from Chris about how to use the resulting heap dump. I figured I'd respond here so that anyone with the same question can find the answer.

First, it occurred to me that I didn't mention one important thing about checkpoints...they must be set when the process executes. You can't download a log from an already-executed process and try to get a new heap dump for it. The checkpoint tells the running process to dump its variable state when the specified line number executes (for the iteration'th time) in the configured Apex type.

Then as you're stepping through the process execution using IC's debugger and you hit that line (again, for the iteration'th time), there's a log entry that tells IC to retrieve the heap dump from the server. Once retrieved, the comprehensive variable state from the heap dump is folded into the debugger's standard Variables view.

Here are some demo videos that show how to get the most out of the debugger:


Hopefully that helps.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages