Zuraffa class

Global configuration and utilities for Zuraffa.

Properties

hashCode → int
The hash code for this object.
no setterinherited
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.
inherited

Operators

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

Static Properties

disableCache ↔ bool
Returns true if caching is globally disabled.
getter/setter pair
enableApiInProfile ↔ bool
Whether the API bridge is active in profile mode.
getter/setter pair
environment → Environment
Get the current application environment.
no setter
hooksEnabled ← bool
Enable/disable all hooks globally.
no getter
interceptorRegistry → InterceptorRegistry
Global interceptor registry for UseCase pipelines.
final
isDebugMode → bool
Returns true if the application is running in debug mode.
no setter

Static Methods

addFailureReporter(FailureReporter reporter, {ReportRetryPolicy? retryPolicy, int? maxQueueSize, int? maxBatchSize, Duration? flushInterval, bool persistFailures = false}) → Future<void>
Register a failure reporter.
captureUncaught(Object error, StackTrace stackTrace, {String? context, bool reportAsFailure = true}) → void
The central uncaught-error funnel.
clearInterceptors() → void
Clear all registered interceptors.
closeUncaughtErrorHandlers() → void
Remove the Dart-level uncaught-error handlers again.
disableLogging() → void
Disable logging.
disposeFailureHooks() → void
Dispose all artifact and failure hooks.
disposeFailureReporters() → Future<void>
Dispose all failure reporters and flush pending reports.
enableLogging({ZuraffaLogLevel level = ZuraffaLogLevel.all, void onRecord(LogRecord record)?}) → void
Enable debug logging for the framework.
flushFailureReports() → Future<void>
Flush all pending failure reports.
installUncaughtErrorHandlers({bool reportAsFailure = true}) → void
Install the Dart-level uncaught-error handlers. Idempotent.
publishArtifact(dynamic data, {required String id, required String contentType, required String reason, String? source, String? label, Map<String, dynamic> metadata = const {}, StackTrace? stackTrace, List<String> pathSegments = const [], String? traceId, String? spanId}) → void
Publish an artifact to all registered hooks (fire-and-forget).
publishArtifactAwaited(dynamic data, {required String id, required String contentType, required String reason, String? source, String? label, Map<String, dynamic> metadata = const {}, StackTrace? stackTrace, List<String> pathSegments = const [], String? traceId, String? spanId}) → Future<void>
Publish an artifact to all registered hooks (awaited).
registerArtifactHook(ArtifactHook hook) → void
Register an artifact hook that reacts to published artifacts.
registerFailureHook(FailureHook hook) → void
Register a failure hook that reacts to errors.
registerHook(Hook hook) → void
Register a generic hook.
registerInterceptor<In, Out>(InterceptorEntry<In, Out> entry) → void
Register a UseCase interceptor for input type In and output type Out.
registerOtelLogExporter(OtelLogExporter exporter) → void
Register a remote log exporter for disposal with disposeFailureReporters. The observability companion calls this from its enableOtelReporting equivalent.
removeFailureReporter(String id) → Future<void>
Remove a failure reporter by ID.
runGuarded(FutureOr<void> body(), {void onError(Object error, StackTrace stackTrace)?, ZoneSpecification? zoneSpecification}) → void
The guarded boot every Zuraffa-family app should use.
setEnvironment(Environment env, {bool? isDebugMode, ZuraffaLogLevel logLevel = ZuraffaLogLevel.all}) → void
Set the application environment and debug mode.
toLevel(ZuraffaLogLevel level) → Level
unregisterArtifactHook(String id) → void
Unregister an artifact hook by its id.
unregisterFailureHook(String id) → void
Unregister a failure hook by its id.
unregisterHook(String id) → void
Unregister a hook by ID.