flutter_paper_trail 0.0.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 69

flutter_paper_trail #

Send logs to Papertrail

Usage #

Setup:

import 'package:flutter_paper_trail/flutter_paper_trail.dart';

FlutterPaperTrail.initLogger(
        hostName: "secret.papertrailapp.com",
        programName: "flutter-test-app",
        port: 9999,
        machineName: "Simulator(iPhone8)");
    //for machine name use Flutter DeviceInfoPlugin

Calling:

FlutterPaperTrail.logError("My message");

Extra setup (when a user is logged in):

FlutterPaperTrail.setUserId("JohnDeer391");

0.0.1 #

Initial release.

0.0.4 #

  • Added setUserId
  • iOS correctly using the result callback.

0.0.5 #

  • iOS plugin handler: fixed if else-if.

example/lib/main.dart

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

import 'package:flutter_paper_trail/flutter_paper_trail.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _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 {
    return FlutterPaperTrail.initLogger(
        hostName: "secret.papertrailapp.com",
        programName: "flutter-test-app",
        port: 9999,
        machineName: "Simulator(iPhone8)");
    //for machine name use Flutter DeviceInfoPlugin
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        floatingActionButton: new FloatingActionButton(
          onPressed: () async {
            await FlutterPaperTrail.logError("I love logging errors on paper trail");
            await FlutterPaperTrail.logInfo("I love logging infos on paper trail");
            await FlutterPaperTrail.logWarning("I love logging warnings on paper trail");
            await FlutterPaperTrail.logDebug("I love logging debugs on paper trail");
          },
          tooltip: 'Log to papertrail',
          child: const Icon(Icons.add),
        ),
        appBar: new AppBar(
          title: const Text('Papertrail logging example'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text('Press the + button to test logging to Papertrail'),
              RaisedButton(
                child: Text('Identify User'),
                onPressed: () {
                  FlutterPaperTrail.setUserId("JohnDeer391");
                },
              ),
              Text('Press the + button again after identifying the user'),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_paper_trail: ^0.0.5

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:flutter_paper_trail/flutter_paper_trail.dart';
  
Version Uploaded Documentation Archive
0.0.5 Jul 10, 2018 Go to the documentation of flutter_paper_trail 0.0.5 Download flutter_paper_trail 0.0.5 archive
0.0.4 Jul 8, 2018 Go to the documentation of flutter_paper_trail 0.0.4 Download flutter_paper_trail 0.0.4 archive
0.0.3 Jul 8, 2018 Go to the documentation of flutter_paper_trail 0.0.3 Download flutter_paper_trail 0.0.3 archive
0.0.2 Jul 5, 2018 Go to the documentation of flutter_paper_trail 0.0.2 Download flutter_paper_trail 0.0.2 archive
0.0.1 Jul 5, 2018 Go to the documentation of flutter_paper_trail 0.0.1 Download flutter_paper_trail 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Mar 6, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.3.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/flutter_paper_trail.dart.

Run flutter format to format lib/flutter_paper_trail.dart.

Format lib/generated/i18n.dart.

Run flutter format to format lib/generated/i18n.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
meta ^1.0.5 1.1.6 1.1.7
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8