All Projects → zubairehman → Flogs

zubairehman / Flogs

Licence: MIT license
An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.

Programming Languages

dart
5743 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Flogs

l
Cross-platform html/io [L]ogger with simple API.
Stars: ✭ 26 (-83.54%)
Mutual labels:  logger, logs, logging-library, dart-library, dart-package
open route service
An encapsulation made around openrouteservice API for Dart and Flutter projects. Made for easy generation of Routes and Directions on Maps, Isochrones, Time-Distance Matrix, Pelias Geocoding, POIs, Elevation and routing Optimizations using their amazing API.
Stars: ✭ 20 (-87.34%)
Mutual labels:  dart-library, flutter-package, dart-package
credit card validator
A Dart package that validates credit card numbers, expiration dates, and security codes (CVV/CVC) based on the type of credit card
Stars: ✭ 19 (-87.97%)
Mutual labels:  dart-library, flutter-package, dart-package
Motion-Tab-Bar
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.
Stars: ✭ 237 (+50%)
Mutual labels:  dart-library, flutter-package, dart-package
dartexif
Dart package to decode Exif data from tiff, jpeg and heic files
Stars: ✭ 16 (-89.87%)
Mutual labels:  dart-library, flutter-package, dart-package
flutter sliding tutorial
User onboarding library with smooth animation of objects and background colors
Stars: ✭ 127 (-19.62%)
Mutual labels:  dart-library, flutter-package, dart-package
ratlog.js
🐀 Ratlog JavaScript library - Application Logging for Rats, Humans and Machines
Stars: ✭ 24 (-84.81%)
Mutual labels:  logger, logs, logging-library
Getwidget
Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.
Stars: ✭ 2,555 (+1517.09%)
Mutual labels:  dart-library, flutter-app, dart-package
LogDNA-Android-Client
Android client for LogDNA
Stars: ✭ 22 (-86.08%)
Mutual labels:  logger, logs, logging-library
Flutter-Custom-Carousel
Flutter Custom Carousel Application Design and Animation - day 18
Stars: ✭ 44 (-72.15%)
Mutual labels:  flutter-package, flutter-example, flutter-app
Flarts
Flutter Charts
Stars: ✭ 61 (-61.39%)
Mutual labels:  flutter-package, dart-package
material-color-utilities
Color libraries for Material You
Stars: ✭ 605 (+282.91%)
Mutual labels:  dart-library, dart-package
beautiful logger
Yet another logger API in Java with beautiful features
Stars: ✭ 60 (-62.03%)
Mutual labels:  logger, logging-library
validated
Ultimate dart / flutter string validators 💃💃
Stars: ✭ 21 (-86.71%)
Mutual labels:  dart-library, dart-package
Simple-Log
dnkpp.github.io/Simple-Log/
Stars: ✭ 13 (-91.77%)
Mutual labels:  logger, logging-library
wasm.dart
WebAssembly virtual machine for Dart [work in progress]
Stars: ✭ 43 (-72.78%)
Mutual labels:  dart-library, flutter-package
sqlite micro logger arduino
Fast and Lean Sqlite database logger for Microcontrollers
Stars: ✭ 128 (-18.99%)
Mutual labels:  logger, logging-library
ink
A Logger backend that logs JSON
Stars: ✭ 64 (-59.49%)
Mutual labels:  logger, logs
FlutterLoadingGIFs
Loading indicator GIFs. Material and Cupertino (Android and iOS) loading indicators in assorted sizes. Use as placeholders for loading remote image assets. Demo: https://gallery.codelessly.com/flutterwebsites/loadinggifs/
Stars: ✭ 28 (-82.28%)
Mutual labels:  flutter-package, flutter-app
Meteor-logger-mongo
🍃 Meteor Logging: Store application log messages in MongoDB
Stars: ✭ 20 (-87.34%)
Mutual labels:  logs, logging-library

banner

FLogs Advance Logging Framework

FLog is an Advanced Logging Framework develop in flutter that provides quick & simple logging solution. All logs are saved to the DB which can then be exported as a zip file.

Overview

FLogs is written in dart. It basically features two types of loggers (FLog & DataLog) with many of advanced features needed for logging. Logs are saved in database which can then be exported in document directory of Android|iOS device. The logs are helpful when developer wants to analyze user activities within the app. These logs can be filtered and sorted easily. Logs can easily be exported as zip file base on filter type, the zip file can then be uploaded to server or to use it locally.

Many times we want to log set of data to analyze certain activity e.g. Location (GPS Coordinates), Device info, Network requests etc. this helps us to quickly identify and fix the issue that is hard to debug when the app is in production. FLogs provide such functionality to log data set into database. These logs can then be fetched by applying different convinience filters availale.

Features

  1. Logs events in files created separately every hour with 'FLogs' logger. (24 hours)
  2. Files can be compressed and exported for time and day filters
  3. Clear Logs easily
  4. Save logs to custom path (Supported in Android only)
  5. Export Logs to custom path as zip file (Supported in Android only)
  6. Custom Log formatting
  7. CSV support
  8. Custom timestamps support
  9. Custom data logging support with 'DataLogs' logger.
  10. Encryption support added
  11. Multiple directory structures
  12. Print logs as String
  13. Export all or single types of logs
  14. Advanced Automation for deleting logs automatically
  15. Exports HTML formatted exceptions
  16. Log level support

Use this package as a library

1. Depend on it

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

dependencies:
  f_logs: ^1.0.x

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:f_logs/f_logs.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

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

iOS

<key>NSPhotoLibraryAddUsageDescription</key>
<string>FLogs would like to save photos from the app to your gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>FLogs would like to access your photo gallery for uploading images to the app</string>

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

1. Simple Trace Log

    FLog.trace(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log");

2. Simple Debug Log

    FLog.debug(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log");

3. Simple Info Log

    FLog.info(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log");

4. Simple Warning Log

    FLog.warning(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log";

5. Simple Error Log

    FLog.error(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log");

6. Simple Severe Log

    FLog.severe(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log");

7. Severe Log with Exception and StackTrace

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

8. Simple Fatal Log

    FLog.fatal(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log");

9. Data Type Log

    FLog.logThis(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log",
      type: LogLevel.SEVERE,
      dataLogType: DataLogType.DEVICE.toString());

Available Methods

FLogs provide many convenience methods to save logs into or to fetch them from database, below is the list of all the methods available:

1. logThis

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. The difference between FLog and DataLogs is described above, you can also check out wiki for more details. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static logThis({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    @required LogLevel type,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

2. trace

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static trace({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

3. debug

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static debug({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

4. info

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static info({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

5. warning

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static warning({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

6. error

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static error({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

7. severe

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static severe({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

8. fatal

Logs string data along with className, methodName, logText and the type of log (LogLevel.SEVERE, LogLevel.INFO) etc. The same method can be used to log exception(s) or data logs. If either className or methodName is not provided, it will automatically be taken by getting calling class and method.

static fatal({
    String className, // This is optional if not provided, then it will automatically be taken by getting calling class
    String methodName, // This is optional if not provided, then it will automatically be taken by getting calling method
    @required String text,
    Exception exception,
    String dataLogType,
    StackTrace stacktrace,
}){}

9. printLogs

Fetches all the logs from database and prints them as a string using StringBuffer()

static printLogs() async {}

10. getAllLogsByCustomFilter

Accepts list of filters as an arguments and returns list of logs based on the provided filters. The use of Filters with their usage is explained in wiki, please checkout wiki for more details.

List<Filter> filters = [Filter.greaterThan('[FieldName]', '[Value]')]

static Future<List<Log>> getAllLogsByCustomFilter(
    {List<Filter> filters}) async {}

11. getAllLogsByFilter

A convenience method that filters data based on the provided filter params e.g. dataLogsType (DataLogType.DEVICE, DataLogType.NETWORK), logLevels(LogLevel.SEVERE, LogLevel.INFO), startTimeInMillis (millisec of the day you from where you want logs to be fetched), endTimeInMillis (milisec of the day you till you want logs to be fetched) and filterType (FilterType.LAST_HOUR, FilterType.LAST_24_HOURS, FilterType.TODAY, FilterType.WEEK, FilterType.ALL). Filter type can't be used with startTimeInMillis, endTimeInMillis, if so the priority will be given to startTimeInMillis, endTimeInMillis. In-order to have full control over filters, use method provided above.

static Future<List<Log>> getAllLogsByFilter(
    {List<String> dataLogsType,
    List<String> logLevels,
    int startTimeInMillis,
    int endTimeInMillis,
    FilterType filterType}}) async {}

12. getAllLogs

Fetches all the logs from database and returns a list of logs.

static Future<List<Log>> getAllLogs() async {}

13. exportLogs

Exports logs to external storage under FLog directory.

static exportLogs() async {}

14. clearLogs

Clears all the logs stored in database.

static clearLogs() {}

15. applyConfigurations

Apply user provided configurations to FLogs.

static applyConfigurations(LogsConfig config) {}

16. deleteAllLogsByFilter

Accepts list of filters as an arguments and delete logs based on the provided filters. The use of Filters with their usage is explained in wiki, please checkout wiki for more details.

List<Filter> filters = [Filter.greaterThan('[FieldName]', '[Value]')]

static deleteAllLogsByFilter(
    {List<Filter> filters}) async {}

Wiki

Checkout wiki for more info

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].