MyLogger improved fork of Flogs package developed in flutter that provides quick & simple logging solution

Related tags

Login MyLogger
Overview

MyLogger

MyLogger is improved fork of Flogs package developed in flutter that provides quick & simple logging solution.
All logs are saved into DB which can be exported as a text file.

Overview

MyLogger is written in Dart.
Logs are saved into Sembast database which can be exported into document directory and uploaded into server.

Logs are helpful when developer wants to analyze user activities within the app. Many times we want to log a set of data to analyze certain activity. For example:

  • Location (GPS Coordinates),
  • Device info,
  • Network requests
  • etc..

This helps us to quickly identify and fix issues that are hard to debug when app is in the production.
MyLogger provide functionality for log these data sets into database and fetch it by different filters.

Features

  1. Log messages by various levels (DEBUG, TRACE, INFO, WARNING, ERROR, SEVERE, FATAL)
  2. Save logs into database
  3. Export logs into file
  4. Fetch or delete logs easily
  5. Log filtering support
  6. Custom timestamps support
  7. Custom data type logging support
  8. Custom log format support
  9. Encryption support

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  my_logger: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:my_logger/logger.dart';

How to use

Log files are exported on storage directory so it's very important to add these permissions to your project's manifest file first.

Android

">

  

  

iOS


   
    NSPhotoLibraryAddUsageDescription
   

   
    MyLogger would like to save photos from the app to your gallery
   

   
    NSPhotoLibraryUsageDescription
   

   
    MyLogger would like to access your photo gallery for uploading images to the app
   

To save logs, simply call any of the method mentioned below:

    MyLogger.trace("My trace log"); 

    MyLogger.debug("My debug log");

    MyLogger.info("My info log");

    MyLogger.warning("My warning log");

    MyLogger.error("My error log");

    MyLogger.severe("My severe log");

    MyLogger.fatal("My fatal log");

    MyLoggerlog(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My severe log with exception and stacktrace",
      type: LogLevel.SEVERE, 
      exception: Exception("This is an Exception!"),
      stacktrace: StackTrace.current,
    );

    MyLoggerlog(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My severe log with dataLogType",
      type: LogLevel.SEVERE,
      dataLogType: DataLogType.DEVICE,
    );

Available Methods

MyLogger provide many other methods for save, filter or fetch logs. Below is list of all this methods:

Get logs:

MyLogger.logs.getAll();   // Get all saved logs
MyLogger.logs.getLastHour();   // Get all saved logs for last hour

// Get logs by LogFilter:
MyLogger.logs.getByFilter(
  LogFilter(
    startDateTime: DateTime(2019), 
    endDateTime: DateTime(2020), 
    dataLogsType: [DataLogType.NETWORK],
    logLevels: [LogLevel.ERROR, LogLevel.WARNING],
  ),  
);

// LogFilters also have some named constructors:
MyLogger.logs.getByFilter(LogFilter.last24Hours());

Write logs:

MyLogger.logs.write(Log log);  // Save your own Log object

Delete logs:

MyLogger.logs.deleteAll();   // Delete all saved logs
MyLogger.logs.deleteLastHour();   // Delete all saved logs for last hour

// Delete logs by LogFilter:
MyLogger.logs.deleteByFilter(
  LogFilter(
    startDateTime: DateTime(2019), 
    endDateTime: DateTime(2020), 
    dataLogsType: [DataLogType.NETWORK],
    logLevels: [LogLevel.ERROR, LogLevel.WARNING],
  ),  
);

Export logs:

File fileExport = await MyLogger.logs.export(
  fileName: "export-all-logs",
  exportType: FileType.TXT,
  filter: LogFilter.last24Hours(),
);

Change configuration:

    LogConfig config = MyLogger.config
      ..outputFormat = "{{level}} {{time}} - {{message}}"
      ..dataLogTypeValues = DataLogType.values
      ..encryption = EncryptionType.XXTEA
      ..encryptionKey = encryptionKey
      ..timestampFormat = TimestampFormat.DEFAULT;

    MyLogger.applyConfig(config);
You might also like...

An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.

An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.

FLogs Advance Logging Framework FLog is an Advanced Logging Framework develop in flutter that provides quick & simple logging solution. All logs are s

Dec 30, 2022

Flutter plugin that provides a quick&dirty workaround for incompatibility between VMWare Airwatch MDM solution and Dart Sockets implementation

airwatch_socket_workaround This plugin has been created to enable flutter apps to reach endpoints that are only reachable using a VMWare airwatch per

Nov 11, 2022

A flutter plugin for improved row and column widgets with added spacing and optional interleaved dividers

flutter_series A flutter plugin for improved row and column widgets with added s

Nov 1, 2021

Dialog flowtter-master - A Flutter implementation of DialogFlow, improved

Dialog flowtter-master - A Flutter implementation of DialogFlow, improved

A Flutter implementation of DialogFlow, improved. Build your integrations with D

Jan 3, 2022

A Flutter implementation of Google's Dialog Flow improved

A Flutter implementation of Google's Dialog Flow improved

A Flutter implementation of DialogFlow, improved. Build your integrations with DialogFlow easier and faster. About the package Dialog Flow on Flutter,

Oct 31, 2022

A fork/modification of flutter epub view package

A fork/modification of flutter epub view package

epub_view Pure flutter widget for view EPUB documents on all platforms. Based on epub package. Render with flutter widgets (not native view) on any pl

Dec 28, 2021

Tiny Dart logging package

Tiny Dart logging package

Aug 3, 2022

A Todo Notes Application developed with flutter, with basic functionalities to write quick Notes.

A Todo Notes Application developed with flutter, with basic functionalities to write quick Notes.

Notes Application - Flutter A Todo Notes Application developed with flutter, with basic functionalities to write quick Notes. NOTES PASSWORD-PROTECTED

Jan 1, 2023

Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Sep 28, 2022

Fluttersettingsui - Fork of settingsui. Create native settings for Flutter app in a minutes.

Fluttersettingsui - Fork of settingsui. Create native settings for Flutter app in a minutes.

Settings UI for Flutter Installing: In your pubspec.yaml dependencies: flutter_settings_ui: ^1.0.1 import 'package:flutter_settings_ui/flutter_setti

Oct 24, 2022

Rich text editor for Flutter based on Delta format (Quill fork)

Visual Editor Visual Editor is a Rich Text editor for Flutter originally forked from Flutter Quill. The editor is built around the powerful Delta docu

Jan 7, 2023

Sane File Logging for Flutter/Dart.

sane_flog A sane flutter api logging library. How to use // initialize logger ... final logger = Logger('url_of_api_to_log_to'); ... // enum Level

Nov 20, 2021

🔖 📱 A book logging app built with Flutter

🔖 📱 A book logging app built with Flutter

galpi Book logging app made with Flutter. Build There are some secret files required for the build. These files include credentials for android build,

Dec 27, 2022

Advanced exception handling and logging for dart/flutter applications

Advanced exception handling and logging for dart/flutter applications

Talker Advanced exception handling and logging for dart/flutter applications 🚀 Log your app actions, catch and handle your app exceptions and errors

Dec 27, 2022

template with tests, login flow, riverpod, logging ect.

Flutter Template What to accomplish has tests basic auth flow riverpod as state provider logging (sentry) navigation (I used Beamer last time but migh

Dec 22, 2022

A Flutter package for a quick and handy giffy dialog.

A Flutter package for a quick and handy giffy dialog.

👏 Giffy Dialogs A beautiful and custom alert dialog for flutter highly inspired from FancyAlertDialog-Android. The source code is 100% Dart, and ever

Dec 29, 2022

[Flutter package] An easy and quick way to check if the local app is updated with the same version in their respective stores (Play Store / Apple Store ).

Retrieve version and url for local app update against store app Android and iOS Features Using as reference packages like in_app_update , version_chec

Nov 9, 2022

ghiNote is a quick note application with a good-looking interface and simple operation.

ghi_note ghiNote is a quick note application with a good-looking interface and simple operation. Getting Started This project is a starting point for

Dec 15, 2021
Owner
Martin Jablečník
Software developer && OpenSource Enthusiast
Martin Jablečník
Console log package

Console log package Usage Download ServerLog application for mac os, window and linux In the main.dart set logEnable = true for release mode Console.l

Nghi-NV 2 Sep 13, 2022
Login UI made in flutter by using simple widgets , icons, buttons, and Colors.

Responsive LogIn UI in Flutter Login UI in Flutter. Visit Website Demo OutPut ## ?? Links Getting Started This project is a starting point for a Flutt

Habib ullah 1 Dec 7, 2021
A Simple User Login Example Using Flutter And Firebase

Kullanıcı Girişi Bu uygulamada Firebase kullanarak kullanıcının giriş, kayıt ve şifre yenileme yapılması sağlanmıştır. Google ve Facebook hesabınızla

null 1 Oct 12, 2022
Flutter Login with Bloc State Management

bloc_app Login with BLoC (Cubit) Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Ebrar Bilgili 3 Jan 19, 2022
A collection of Login Screens, Buttons, Loaders and Widgets with attractive UIs built with Flutter

Flutter Screens A collection of Login Screens, Buttons, Loaders and Widgets with attractive UIs, built with Flutter, ready to be used in your applicat

Pham Quoc Duy 2 Dec 20, 2022
Animated Login for Flutter is a ready-made login/signup screen with soft and pleasant animations.

Animated Login Author: Bahrican Yeşil Animated Login for Flutter is a ready-made login/signup screen with soft and pleasant animations. It is fully re

Bahrican Yesil 93 Jan 3, 2023
Beautiful Flutter login page

Login Page A Beautiful login page UI like this Login_Page Use in your application Tank you ☺ Platform ios ✔️ android ✔️ responsive Can be used on all

Amirziya 18 Dec 27, 2022
Flutter Web Signin Signup ui design

FlutterWebSigninSignup Intro Flutter Web Signin & Signup screen ui desing. Front-end: Flutter Check the screenshot : P.S Make sure to upgrade your Flu

Ihab Zaidi 12 Dec 15, 2022
A log in page for Abbey Foods app using Flutter

Abbey-Foods-App-Log-In-Page A log in page for Abbey Foods' app using Flutter. This is the capstone project assigned to Group 11, MObile App developmen

MubaH_dev 15 Oct 17, 2022
Responsiv ogin page flutter

responsiv_login_page_flutter A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get

Ali 3 Oct 26, 2021