Skip to content

curogom/flutter_live_logger

Repository files navigation

Flutter Live Logger πŸš€

pub package pub points popularity likes License: MIT CI/CD

Production-ready real-time logging solution for Flutter applications with 400K+ logs/second throughput, offline support, and real-time dashboard.

πŸ“– Languages: English β€’ ν•œκ΅­μ–΄

🌟 What's New in v0.3.0

πŸš€ Zero-Configuration Start

// Just one line to start!
await FlutterLiveLogger.start();

πŸ§™β€β™‚οΈ Major Improvements

  • Zero-config initialization - Start logging with a single line of code
  • Interactive setup wizard - GUI-based configuration generator
  • VS Code snippets - Rapid development with code snippets
  • WebSocket stability - Fixed critical concurrency bugs
  • Flutter 3.24+ support - Full compatibility with latest Flutter

πŸ“¦ Packages

This monorepo contains two packages:

pub package

Core logging library with:

  • πŸš€ 400K+ logs/second throughput
  • 🌐 Cross-platform support (iOS, Android, Web, Desktop)
  • πŸ’Ύ Multiple storage options (Memory, SQLite)
  • πŸ”„ Multiple transport layers (Memory, File, HTTP)
  • πŸ“± Automatic navigation tracking
  • πŸ”Œ Offline support with sync

pub package

Web dashboard for real-time monitoring:

  • πŸ“Š Real-time log streaming via WebSocket
  • πŸ“ˆ Performance analytics and metrics
  • πŸ” Advanced filtering and search
  • πŸ“± Responsive design
  • 🎨 Modern Flutter web UI

πŸš€ Quick Start

Installation

dependencies:
  flutter_live_logger: ^0.3.0

dev_dependencies:
  flutter_live_logger_dashboard: ^0.3.0  # Optional dashboard

Basic Usage

import 'package:flutter_live_logger/flutter_live_logger.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Start with zero configuration
  await FlutterLiveLogger.start();
  
  runApp(MyApp());
}

// Use anywhere in your app
FlutterLiveLogger.info('App started');
FlutterLiveLogger.error('Something went wrong', error: exception);
FlutterLiveLogger.event('user_login', {'user_id': userId});

πŸ’‘ Real-World Examples

E-commerce App

// Track user journey
FlutterLiveLogger.event('product_viewed', {
  'product_id': product.id,
  'category': product.category,
  'price': product.price,
});

// Monitor performance
final stopwatch = Stopwatch()..start();
await api.processPayment();
FlutterLiveLogger.info('Payment processed', data: {
  'duration_ms': stopwatch.elapsedMilliseconds,
  'amount': payment.amount,
});

Error Tracking

try {
  await riskyOperation();
} catch (error, stackTrace) {
  FlutterLiveLogger.error(
    'Operation failed',
    error: error,
    stackTrace: stackTrace,
    data: {'user_id': currentUser.id},
  );
}

πŸ› οΈ Configuration

Environment-Specific Setup

// Development
await FlutterLiveLogger.startDevelopment();

// Production with custom transports
await FlutterLiveLogger.init(
  config: LoggerConfig.production(
    transports: [
      HttpTransport(config: HttpTransportConfig(
        endpoint: 'https://api.your-domain.com/logs',
        apiKey: 'your-api-key',
      )),
      FileTransport(config: FileTransportConfig(
        directory: '/logs',
        compressRotatedFiles: true,
      )),
    ],
  ),
);

Navigation Tracking

MaterialApp(
  navigatorObservers: [
    FlutterLiveLoggerNavigatorObserver(
      enableDurationTracking: true,
      enableBreadcrumbs: true,
    ),
  ],
  home: HomeScreen(),
);

πŸ“Š Dashboard Usage

Start the dashboard server:

import 'package:flutter_live_logger_dashboard/flutter_live_logger_dashboard.dart';

void main() async {
  final server = DashboardServer();
  await server.start(port: 8080);
  print('Dashboard running at http://localhost:8080');
}

🎯 Key Features

Performance

  • ⚑ 400,000+ logs/second throughput
  • πŸš€ < 50ms initialization time
  • πŸ’Ύ < 10MB memory footprint
  • πŸ”„ Smart batching for efficiency

Reliability

  • πŸ”Œ Offline support - Queue logs when offline
  • πŸ›‘οΈ Error resilience - Graceful degradation
  • πŸ“¦ Multiple transports - Fallback options
  • πŸ§ͺ 95%+ test coverage - Battle-tested

Developer Experience

  • 🎯 Zero-config start - One line setup
  • πŸ“š Rich documentation - Comprehensive guides
  • πŸ› οΈ VS Code snippets - Rapid development
  • 🌍 Cross-platform - Write once, run everywhere

πŸ“– Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/curogom/flutter_live_logger.git
cd flutter_live_logger

# Install dependencies
flutter pub get

# Run tests
flutter test

# Run example app
cd packages/flutter_live_logger/example
flutter run

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

Special thanks to all contributors and the Flutter community for their support and feedback.

πŸ“¬ Support


Made with ❀️ by curogom.dev

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •