LogInterceptor class

Log interceptor to capture print statements and logs

Constructors

LogInterceptor()

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

interceptionZone Zone?
Get the interception zone (for running code that should have print intercepted)
no setter
isEnabled bool
Check if interception is enabled
no setter
updateTrigger SwiftValue<List<InterceptedLogEntry>>
Get update trigger for reactive UI updates (accesses the reactive list)
no setter

Static Methods

captureLog({required String message, required LogType type, Object? data, StackTrace? stackTrace}) → void
Capture a log entry
clear() → void
Clear all logs
disable() → void
Disable log interception
enable({int maxLogs = 500}) → void
Enable log interception Preserves existing logs across hot reloads
getLogs() List<InterceptedLogEntry>
Get all captured logs
getLogsByType(LogType type) List<InterceptedLogEntry>
Get logs filtered by type
runInZone<T>(T callback()) → T
Run code in the interception zone to capture print statements This is useful for wrapping specific code blocks
setMaxLogs(int max) → void
Set maximum number of logs to keep