flutter_paper_trail 0.0.5

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

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]
48
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]
68
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3
  • Flutter: 0.8.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v0.1 release.

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

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.

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
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8