TomDiagnosticNotice class
A finding that has to be both shown and logged.
The redaction rule is that secrets are structurally unable to reach a log, and that rule only has teeth while the payload is still data. But some findings are also addressed to a person, and a person needs a sentence. Producing the sentence and then handing it to the sink would defeat the rule; producing the sentence somewhere else and the fields here would let the two drift.
So one producer emits both halves at once. fields is what the log keeps; message is what the user reads; neither is derived from the other, and a caller branches on operation or fields, never on the rendered text.
Constructors
-
TomDiagnosticNotice({required String operation, required Map<
String, Object?> fields, required String message, TomDiagnosticLevel level = TomDiagnosticLevel.warn})
Properties
- event → TomDiagnosticEvent
-
The log form. A fresh event each call, so its
atis the moment it was recorded rather than the moment the finding was made — the two differ whenever a finding is carried across an await, which is every time one travels out of a factory.no setter -
fields
→ Map<
String, Object?> -
JSON-shaped payload. Carries locators, never contents.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- level → TomDiagnosticLevel
-
final
- message → String
-
The sentence, already phrased for a person.
final
- operation → String
-
Dotted operation name, as TomDiagnosticEvent.operation.
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
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited