sanitize static method

String sanitize(
  1. String message
)

Scrubs well-known secret shapes (JWTs, bearer tokens, password=..., card numbers) out of a free-form log message.

Implementation

static String sanitize(String message) {
  var out = message;
  for (final pattern in _sensitivePatterns) {
    out = out.replaceAll(pattern, redactedPlaceholder);
  }
  return out;
}