shouldDowngradeForDatadog

fun shouldDowngradeForDatadog(severity: Severity, throwable: Throwable?): Boolean(source)

Whether the Datadog writer must downgrade an error-level log to WARN.

Datadog has no per-call opt-out: its SDK turns any log at ERROR or above into a RUM error, throwable or not. Downgrading the emitted level is the only way to keep something out of RUM error tracking while still emitting the log line.

This intentionally does not mirror shouldReportAsException for CancellationException. Crashlytics filters cancellations because it is a crash-triage tool; Datadog keeps them because a cancellation logged at error level means some call site swallowed it instead of rethrowing — broken structured concurrency, and a real bug. That asymmetry is what surfaced the swallowed-cancellation defects fixed in #6468, so it is load-bearing: do not "unify" the two rules.