log_pilot library
LogPilot — prettified, structured console logging for Flutter.
import 'package:log_pilot/log_pilot.dart';
void main() {
LogPilot.init(config: LogPilotConfig(), child: const MyApp());
}
// Anywhere:
LogPilot.info('Hello world');
Classes
- AsyncLogSink
- A LogSink whose flush callback runs on a microtask boundary, receiving a batch of records instead of one at a time.
- Breadcrumb
- A lightweight event marker captured before an error occurs.
- BreadcrumbBuffer
- A fixed-size circular buffer for Breadcrumbs.
- BufferedCallbackSink
- A LogSink that collects records and flushes them in batches, either when maxBatchSize is reached or after flushInterval.
- CallbackSink
- A LogSink that forwards records to a plain callback.
- LogHistory
- A fixed-size circular buffer that retains the most recent log records.
- LogPilot
- The primary entry point for the LogPilot package.
- LogPilotConfig
- Global configuration for LogPilot.
- LogPilotDiagnostics
- Self-monitoring diagnostics for LogPilot.
- LogPilotDiagnosticsSnapshot
- Immutable snapshot of diagnostics state.
- LogPilotHttpClient
-
A wrapper around
http.Clientthat logs all requests through LogPilot. - LogPilotLogger
- A scoped logger instance that auto-applies a tag to every log.
- A NavigatorObserver that automatically logs route transitions.
- LogPilotOverlay
- A debug overlay that displays recent log records in a draggable, resizable sheet.
- LogPilotPrinter
- The formatted output engine for LogPilot.
- LogPilotRecord
- A structured log entry produced by LogPilot.
- LogPilotZone
- Manages the global LogPilot state and error-catching zones.
- LogSink
- Interface for log output destinations.
- StackTraceSimplifier
- Filters and simplifies Dart/Flutter stack traces for readability.
Enums
- AnsiColor
- ANSI terminal colors for log output.
- AnsiStyle
- ANSI terminal text styles.
- ExportFormat
- Output format for LogPilot.export.
- LogLevel
- Severity levels for log messages, ordered by priority.
- OutputFormat
- Controls how LogPilot renders log output to the console.
Properties
- isAnsiSupported → bool
-
Whether the environment supports ANSI escape codes.
no setter
Functions
-
setAnsiSupported(
bool supported) → void - Override ANSI support detection (useful for testing or web).
-
stripAnsi(
String text) → String -
Strip all ANSI escape sequences from
text.
Typedefs
- LogPilotErrorCallback = void Function(Object error, StackTrace? stack)
- Callback for forwarding errors to external services like Crashlytics.