Giter Site home page Giter Site logo

samarsajad / logsuite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avinashkranjan/logsuite

0.0 0.0 0.0 403 KB

Logsuite is a versatile plugin for Flutter apps, seamlessly capturing screenshots, crash logs, and network activity. With automated logging and storage, it ensures comprehensive monitoring and debugging, enhancing app stability and performance.

Home Page: http://logsuite.avinashranjan.com

License: MIT License

C++ 45.49% C 2.73% Objective-C 0.07% Kotlin 0.23% Dart 7.47% Swift 3.31% HTML 3.53% CMake 37.17%

logsuite's Introduction

LogSuite

LogSuite is a Flutter plugin designed to capture screenshots every 100ms, record crash logs, and log network activity. This plugin helps developers monitor and debug their applications efficiently by providing comprehensive logging capabilities. The plugin follows good architectural practices and focuses on functionality and correctness.

Features

  1. Screenshot Capture:

    • Automatically captures screenshots every 100ms and saves them to device storage.
    • Inspired by UxCam/UserExperior for capturing screenshots without explicit permission.
  2. Crash Log Recording:

    • Automatically captures and records crash logs with relevant information when a crash occurs.
    • Saves crash logs to device storage and provides an API for retrieval.
  3. Network Log Capture:

    • Intercepts and logs all network requests and responses.
    • Saves network logs to device storage and exposes an API for retrieval.

Architecture

LogSuite follows a modular architecture with a focus on clean code and maintainability. The plugin uses a combination of MVC and BLoC patterns to ensure a clear separation of concerns and to make the codebase easy to navigate and extend.

Installation

To use this plugin, add flutter_log_capture as a dependency in your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  flutter_log_capture: ^0.1.0

Usage

Initializing the Plugin

To initialize the plugin, call the initialize method in your main function:

import 'package:flutter/material.dart';
import 'package:flutter_log_capture/flutter_log_capture.dart';

void main() {
  FlutterLogCapture.initialize();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'LogSuite Demo',
      home: HomePage(),
    );
  }
}

Sample Application

The sample application demonstrates the integration and usage of the plugin. It includes functionality for:

  • Capturing screenshots manually.
  • Triggering a crash to test crash log recording.
  • Making a network request to test network log capture.

HomePage Widget

import 'package:flutter/material.dart';

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('LogSuite Demo'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                // Implement screenshot capture functionality
              },
              child: Text('Capture Screenshot'),
            ),
            ElevatedButton(
              onPressed: () {
                // Trigger a crash for demonstration
                throw Exception('Test crash');
              },
              child: Text('Cause Crash'),
            ),
            ElevatedButton(
              onPressed: () {
                // Make a network request for demonstration
              },
              child: Text('Make Network Request'),
            ),
          ],
        ),
      ),
    );
  }
}

Capturing Screenshots

To capture screenshots every 100ms and save them to device storage, the ScreenshotCapture class in the plugin handles the functionality. Ensure it is properly initialized.

Recording Crash Logs

Crash logs are automatically captured using the CrashLogRecorder class. You can retrieve the crash logs through the provided API.

Logging Network Activity

The NetworkLogCapture class intercepts and logs network requests and responses. These logs are saved to device storage and can be accessed via the API.

Contributing

We welcome contributions! Please see the CONTRIBUTING.md file for more details on how to get started.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any questions or concerns, please open an issue on GitHub or contact me at [email protected].

Thank you for using LogSuite!

logsuite's People

Contributors

avinashkranjan avatar imgbotapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.