LogRedactor class

Redacts sensitive fields from log record data.

Matches field names (case-insensitive) and replaces values with replacement.

Constructors

LogRedactor({required List<String> fields, String replacement = '[REDACTED]'})
Creates a redactor that masks the given fields (case-insensitive).

Properties

hashCode int
The hash code for this object.
no setterinherited
isActive bool
Returns true if there are fields to redact.
no setter
replacement String
String substituted for redacted values. Defaults to '[REDACTED]'.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redact(Map<String, Object> data) Map<String, Object>
Redacts matching keys in data. Returns a new map (does not mutate input).
redactString(String input) String
Redacts sensitive patterns in a free-text string.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited