Skip to content

silenceApexClasses

silenceApexClasses(connection, classNames, onPhase?): Promise<ApexTraceSilenceOutcome>

Defined in: packages/simply-apex-core/src/apexTraceSilence.ts:122

Creates or updates a 24-hour CLASS_TRACING trace flag with a fully suppressed (NONE) debug level for each of classNames, preventing those classes from generating debug log output. A class that already has a trace flag has its expiration extended instead of getting a duplicate.

Connection

The org connection to silence classes in.

string[]

The Apex class names to silence — see resolveClasses.

(phase) => void

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

Promise<ApexTraceSilenceOutcome>

The trace flag created/updated per successfully-silenced class, plus any class names that don’t exist in the org and any per-class create/update failures.

no-classes-specified if classNames is empty, debug-level-create-failed if the shared Silence debug level doesn’t exist yet and couldn’t be created.