LoggingLayer class

LAYER 7 — Logs every request and the decision reached by the pipeline up to this point.

This layer is designed to run LAST in the pipeline, so it can record the final outcome (allowed/flagged) for requests that made it all the way through. It always allows the request — logging never blocks traffic. For simplicity this uses print; swap sink for a real logging backend (file, remote log service) in production.

Implemented types

Constructors

LoggingLayer({void sink(String line)?})
Creates a logging layer. Defaults to writing to stdout via print unless a custom sink is provided.

Properties

hashCode int
The hash code for this object.
no setterinherited
history List<SecurityLogEntry>
In-memory history of everything logged, useful for tests/inspection.
final
name String
A short, stable, human-readable name used in logs and results.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sink → void Function(String line)
Where log lines are written. Defaults to print, but can be overridden (e.g. to write to a file or forward to a log service).
final

Methods

check(RequestContext context) Future<SecurityResult>
Inspects context and returns a SecurityResult.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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