LogCapture class

Captures Dart print output and Flutter framework errors into a LogBuffer.

Start capture by calling install. The captured zone is returned so the caller can run their app inside it (required for print interception).

Flutter errors reported through FlutterError.onError are captured regardless of zone, because FlutterError.onError is a global callback.

Constructors

LogCapture({LogBuffer? buffer})

Properties

buffer LogBuffer
final
hashCode int
The hash code for this object.
no setterinherited
isInstalled bool
Whether install has been called.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

install() Zone
Installs the capture hooks and returns a Zone whose print calls are intercepted. The caller should run their application inside this zone:
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runZoned<T>(T body()) → T
Runs body inside the capture zone. Convenience wrapper around install + Zone.run.
toString() String
A string representation of this object.
inherited
uninstall() → void
Removes the capture hooks. After calling this, new print calls and Flutter errors are no longer captured.

Operators

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