flutter_fimber_filelogger 1.1.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

File Logger Tree for Fimber #

Pub

A tree for the Fimber Flutter library that will write the logs to a File for each day.

Getting started #

1) Dependency setup #

First import the library to your project in your pubspec.yaml:

  • 1.1.x uses intl 0.16+
  • 1.0.x uses intl 0.15.x
flutter_fimber_filelogger: ^1.1.1+1

# or 

flutter_fimber_filelogger: ^1.0.2

2) Import the library in your Dart code #

import 'package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart';

3) Plant the tree #

Fimber.plantTree(FileLoggerTree());  

Files #

The files will be stored in the [getApplicationDocumentsDirectory]/logs directory.

For each day, a new File will be created. An auto-clean mechanism is available, where you have to specify the number of days to keep the files onto the disk:

Fimber.plantTree(FileLoggerTree(numberOfDays: 5));  

To disable it, just pass a null value.

[1.1.1+1] - 4th December 2019 #

  • Flutter fimber dependency upgraded to 0.3.2

[1.1.1] - 2nd December 2019 #

  • Dependencies upgraded

[1.1.0] - 7st September 2019 #

  • intl dependency upgraded to 0.16

[1.0.2] - 7st September 2019 #

  • Allow to pass a null "numberOfDays" which will disable the auto-clean mechanism
  • An example is now available in the repo

[1.0.1] - 1st September 2019 #

  • Fix a bug with DateFormat

[1.0.0] - 1st September 2019 #

  • Initial Release.

example/lib/main.dart

import 'package:fimber/fimber.dart';
import 'package:flutter/material.dart';
import 'package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart';

void main() {
  Fimber.plantTree(
      FileLoggerTree(levels: FileLoggerLevels.ALL, numberOfDays: 5));
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });

    Fimber.d('Counter clicked $_counter times!');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_fimber_filelogger: ^1.1.1+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform android

Because:

  • package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart that imports:
  • package:flutter_fimber_filelogger/src/file_logger_tree.dart that imports:
  • package:path_provider/path_provider.dart that imports:
  • package:path_provider_linux/path_provider_linux.dart that declares support for platforms: linux

Package does not support Flutter platform ios

Because:

  • package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart that imports:
  • package:flutter_fimber_filelogger/src/file_logger_tree.dart that imports:
  • package:path_provider/path_provider.dart that imports:
  • package:path_provider_linux/path_provider_linux.dart that declares support for platforms: linux

Package does not support Flutter platform linux

Because:

  • package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart that imports:
  • package:flutter_fimber_filelogger/src/file_logger_tree.dart that imports:
  • package:flutter_fimber/flutter_fimber.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart that imports:
  • package:flutter_fimber_filelogger/src/file_logger_tree.dart that imports:
  • package:path_provider/path_provider.dart that imports:
  • package:path_provider_linux/path_provider_linux.dart that declares support for platforms: linux

Package does not support Flutter platform web

Because:

  • package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart that imports:
  • package:flutter_fimber_filelogger/src/file_logger_tree.dart that imports:
  • package:path_provider/path_provider.dart that declares support for platforms: android, ios, linux, macos

Package does not support Flutter platform windows

Because:

  • package:flutter_fimber_filelogger/flutter_fimber_filelogger.dart that imports:
  • package:flutter_fimber_filelogger/src/file_logger_tree.dart that imports:
  • package:path_provider/path_provider.dart that declares support for platforms: android, ios, linux, macos

Package not compatible with SDK dart

Because:

  • flutter_fimber_filelogger that is a package requiring null.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (flutter_fimber).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_fimber ^0.3.2 0.3.2 0.4.2
intl ^0.16.0 0.16.1
path ^1.6.4 1.7.0
path_provider ^1.4.5 1.6.11
synchronized ^2.1.0+2 2.2.0+1
Transitive dependencies
collection 1.14.12 1.14.13
file 5.2.1
fimber 0.3.3 0.4.2
meta 1.1.8 1.2.1
path_provider_linux 0.0.1+2
path_provider_macos 0.0.4+3
path_provider_platform_interface 1.0.2
platform 2.2.1
plugin_platform_interface 1.0.2
process 3.0.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
xdg_directories 0.1.0
Dev dependencies
flutter_test