When to use apex replay debugger in VS Code?

When to use apex replay debugger in VS Code?

The replay debugger can be used from logs generated by running tests or for debugging interactive or non-interactive code and can be downloaded and run right from VS Code. Apex Replay Debugger also makes it easy to work asynchronously and collaborate with others to solve problems.

Why does apex truncate my Debug log line?

This is a feature (although in this case you may not view it as such, understandably) of the built in toString on apex collection types. The idea being that since the debug log has a maximum size debugging a single large collection would truncate other potentially valuable log lines.

How to add apex replay to launch.json file?

Click at the top of the debug panel to open the launch.json configuration. If your launch.json file is missing the Apex Replay Debugger configuration, click the Add Configuration… button. From the options list, select Apex Replay Debugger: Launch.

When to inject line breaks in apex debug?

If you are debugging large objects or lists, enclosing your debug contents with JSON.serializePretty (), eg: will insert line breaks, which allow your debug to exceed the normal character limit. For long solid strings, however, you will need to inject linebreaks manually, which I do using this:

How to launch replay debugger in Visual Studio Code?

Because you can launch a replay debugger session from any replay-enabled log file, clients and coworkers can share logs to help solve problems. To start a debugging session simply open a log file and right-click to launch the debugger. For details, check out our docs in the Visual Studio Code Marketplace.

How to run apex test in Visual Studio Code?

In Visual Studio Code, click the View menu then choose Command Palette…. Alternatively, you can use the keyboard shortcut Ctrl+Shift+P (Windows or Linux) or Cmd+Shift+P (macOS) to open the Command Palette. Enter apex test in the search box, then choose SFDX: Run Apex Tests.

When to replay a Salesforce DX Debug log?

When replaying a debug log, make sure that your Salesforce DX project contains the same Apex source code that generated the debug log. Otherwise, line numbers and variables referenced by the debugger might lead you to confusion instead of to discoveries.