Files
Neeraj 08c38086a5 Add process prefix filtering and improve log filter dialog UI
- Add process prefix filter section with user-friendly display names
- Move process filter above loggers in dialog layout
- Compact dialog design: reduce sizes, padding, and font sizes
- Optimize filter chip layout for better mobile experience

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 11:32:58 +05:30
..
2025-09-11 07:53:13 +05:30

Log Viewer

A Flutter package that provides an in-app log viewer with advanced filtering capabilities for Ente apps.

Features

  • 📝 Real-time log capture and display
  • 🔍 Advanced filtering by logger name, log level, and text search
  • 🎨 Color-coded log levels for easy identification
  • 📊 SQLite-based storage with automatic truncation
  • 📤 Export filtered logs as text
  • Performance optimized with batch inserts and indexing
  • 🏷️ Optional prefix support for multi-process logging

Usage

1. Initialize in your app

import 'package:log_viewer/log_viewer.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Initialize log viewer (basic)
  await LogViewer.initialize();
  
  // Or with a prefix for multi-process apps
  await LogViewer.initialize(prefix: '[MAIN]');
  
  runApp(MyApp());
}

2. Open the log viewer

// As a navigation action
LogViewer.openViewer(context);

// Or embed as a widget
LogViewer.getViewerPage()

3. Automatic log capture

The log viewer automatically registers with Logger.root.onRecord to capture all logs from the logging package. No additional setup is required.

Filtering Options

  • Logger Name: Filter by specific loggers (e.g., "auth", "sync", "ui")
  • Log Level: Filter by severity (SEVERE, WARNING, INFO, etc.)
  • Text Search: Search within log messages and error descriptions
  • Time Range: Filter logs by date/time range

Database Management

  • Logs are stored in a local SQLite database
  • By default, automatic truncation keeps only the most recent 10000 entries
  • Batch inserts for optimal performance