Skip to main content

safeValue()

function safeValue\<T\>(value: T): {
  __safe: true;
  value: T;
};

Defined in: src/lib/logging/redaction.ts:1001

Marks a value as safe to log without redaction. Use this sparingly and only for values you're certain don't contain PII.

Type Parameters​

Type Parameter
T

Parameters​

ParameterTypeDescription
valueTThe value to mark as safe.

Returns​

{
  __safe: true;
  value: T;
}

An object that will be logged without redaction.

NameTypeDefined in
__safetruesrc/lib/logging/redaction.ts:1001
valueTsrc/lib/logging/redaction.ts:1001

Example​

// This email will be logged without redaction
logger.info("System email", { email: safeValue("no-reply@system.local") });