Skip to content

setupApexTrace

setupApexTrace(connection, options?, onPhase?): Promise<ApexTraceSetupResult>

Defined in: packages/simply-apex-core/src/apexTraceSetup.ts:205

Creates or updates a DEVELOPER_LOG trace flag for a target user. The target user is the one connection authenticates as by default, or the user identified by options.onBehalfOf if given. By default the trace flag uses the FINEST/FINER ReplayDebuggerLevels debug level suitable for the Apex Replay Debugger and runs for 24 hours starting now; options.logLevel/startDate/endDate override those defaults.

Connection

The org connection to configure the trace flag in.

ApexTraceSetupOptions = {}

See ApexTraceSetupOptions.

(phase) => void

Called as each of the three phases (finding the user, checking the debug level, configuring the trace flag) starts — a caller (the CLI) can use this to update a spinner. Optional; has no effect on the operation itself.

Promise<ApexTraceSetupResult>

The IDs of the debug level and trace flag that were created or updated, and the trace flag’s new expiration date.

See ApexTraceSetupErrorCode.