LogRedactor class
Masks secrets before data is logged, shown in a debug tool or sent to a crash reporter.
Constructors
-
LogRedactor({List<
String> sensitiveKeys = defaultSensitiveKeys, String mask = '***', bool maskPatterns = true}) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- mask → String
-
final
- maskPatterns → bool
-
Also masks JWTs,
Bearertokens and card numbers inside strings.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sensitiveKeys
→ List<
String> -
final
Methods
-
isSensitiveKey(
Object? key) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
redact(
dynamic value) → dynamic -
A deep copy of
valuewith sensitive map entries masked. Strings are passed through redactText. -
redactText(
String text) → String -
textwith JWTs, bearer tokens and card numbers masked. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
defaultSensitiveKeys
→ const List<
String> -
Map keys are masked when they contain one of these (case-insensitive).
Words of 4 letters or fewer must be a whole word of the key, so
pinmaskspinanduserPinbut notshipping.