flutter_fimber 0.4.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 92

Flutter plug-in for Fimber #

This plug-in will make the logging via Fimber into native OS logging output.

Getting Started - import #

Dependency setup #

  flutter_fimber: ^0.4.2

Import setup #

import 'package:flutter_fimber/flutter_fimber.dart';

Plant a log tree #

In code on start of your application add FimberTree like this:

  Fimber.plantTree(FimberTree());

iOS and Android platforms supported.

For more usage see Fimber project

[0.4.2] - Fixed versioning #

  • fixed versioning

[0.4.1] - Bug fixes #

  • #75 issue - Fix for TimedRollingFileTree missing passed logLevels and logFormat
  • #73 issue - Fix for mute levels list not being distinct

0.4.0 Update to match fimber io/base split. #

0.3.2 AndroidX update and versions bump (thx: g123k) #

0.3.1 Fixes incorrect Android package structure #

0.3.0 Code style updates and bug fixes #

0.2.0 Colorize logs #

  • Based on fimber 0.2.0 added colorized logs.

0.1.9 Kotlin and Gradle plugin version bump #

  • Kotlin version: 1.3.21
  • Gradle plugin version 3.3.1

0.1.8 Support for stacktrace #

  • Support for stacktrace form try catch block from 0.1.8 fimber package

0.1.7 Following 0.1.7 build of fimber #

  • dynamic typ for ex paramter passed to log methods.

0.1.5 parity update with fimber #

0.1.4 iOS update #

  • dump stacktrace for exception passed to log method

0.1.3 iOS plugin release #

  • iOS plugin part
  • other 0.1.3 updates from Fimber

0.1.2 Android Plugin release for fimber dart logging #

  • First version with Android Log support
  • Adds stacktrace from dart to std output when exception is passed
  • Log levels passed through

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:fimber_io/fimber_io.dart';
import 'package:flutter_fimber/flutter_fimber.dart';

void main() {
  Fimber.plantTree(FimberTree(useColors: true));
  Fimber.plantTree(DebugBufferTree.elapsed());
  Fimber.plantTree(SizeRollingFileTree(DataSize.mega(3),
      filenamePrefix:
          "/data/user/0/com.perlak.flutterfimberexample/app_flutter/log_"));

  runApp(MyApp());
}

/// Example app for showing usage of Fimber
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Fimber Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text('Fimber test'),
              FlatButton(
                child: Text("LOG - ERROR"),
                onPressed: () {
                  Fimber.e("Error message test ${DateTime.now()}");
                },
              ),
              FlatButton(
                child: Text("LOG - INFO"),
                onPressed: () {
                  Fimber.i("Info message test ${DateTime.now()}");
                },
              ),
              FlatButton(
                child: Text("LOG - DEBUG"),
                onPressed: () {
                  Fimber.d("Debug message test ${DateTime.now()}");
                },
              ),
              FlatButton(
                child: Text("LOG - WARNING with exception"),
                onPressed: () {
                  try {
                    throw Exception("Test exception here");
                  } on dynamic catch (e) {
                    Fimber.w("Warning message test ${DateTime.now()}", ex: e);
                  }
                },
              ),
              FlatButton(
                child: Text("LOG - WARNING with Error and stacktrace"),
                onPressed: () {
                  try {
                    throw AssertionError();
                  } on dynamic catch (e, s) {
                    Fimber.w("Warning message test ${DateTime.now()}",
                        ex: e, stacktrace: s);
                  }
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_fimber: ^0.4.2

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/flutter_fimber.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:flutter_fimber/flutter_fimber.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:flutter_fimber/flutter_fimber.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:flutter_fimber/flutter_fimber.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:flutter_fimber/flutter_fimber.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [flutter_fimber] that is in a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
fimber ^0.4.2 0.4.2
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
test ^1.5.1