ConsoleLoggingHook class

A hook that logs evaluation lifecycle events to stdout.

Per Appendix A, it can optionally print the evaluation context in a human-readable serialized form.

Inheritance
  • Object
  • Hook
  • ConsoleLoggingHook

Constructors

ConsoleLoggingHook({bool printContext = false, String domain = 'flag_evaluation', void logger(String message)?})

Properties

domain String
Optional domain label for logs.
final
hashCode int
The hash code for this object.
no setterinherited
logFunction ↔ void Function(String message)
Allows overriding the print function for testing.
getter/setter pair
metadata → HookMetadata
Hook metadata and configuration
no setteroverride
printContext bool
Controls whether evaluation context is included in logs.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

after(HookContext context) Future<void>
After successful evaluation
override
before(HookContext context) Future<void>
Before flag evaluation
override
error(HookContext context) Future<void>
When an error occurs
override
finally_(HookContext context, EvaluationDetails? evaluationDetails, [HookHints? hints]) Future<void>
Always executed at the end, now with evaluation details parameter
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