flutter_native_log 0.3.0

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

flutter_native_log

Flutter Plugin to print Log messages

You can set either in production or in debug once

if production
    NO Logs in production
  
 if debug 
     debug
     warning
     info
     error
     verbose
     wtf  

Usage

import dependency


dependencies:
  flutter_native_log: "^0.3.0"
  
// import
import 'package:flutter_native_log/flutter_native_log.dart';

// initialize
FlutterNativeLog flutterNativeLog = new FlutterNativeLog();

// set production or debug default to debug
flutterNativeLog.setIsProduction(isProduction: true);


//Start logging
flutterNativeLog.w(tag: "Karthik", msg: "This is Test Warning"); // logType = warning
    flutterNativeLog.e(tag: "Karthik", msg: "This is Test Error"); // logType = error
    flutterNativeLog.d(tag: "Karthik", msg: "This is Test Debug"); // logType = debug
    flutterNativeLog.i(tag: "Karthik", msg: "This is Test Info"); // logType = debug
    flutterNativeLog.v(tag: "Karthik", msg: "This is Test Verbose"); // logType = debug
    flutterNativeLog.wtf(tag: "Karthik", msg: "This is Test WTF"); // logType = debug
//if you want to log in production

flutterNativeLog.d(tag: "Karthik", msg: "This is Test Log from Production", forceLog: true);

[0.3.0]

*Replaced LogType with different function each type

[0.2.0]

*Bug Fixes *No Logs will be printed in production *If you want to print in production use forceLog: true

[0.1.0]

*Initial release *User can set logging environment *Logs are printer from Native code

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_native_log/flutter_native_log.dart';
import 'package:flutter_native_log_example/sec.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  //get instance of FlutterNativeLog
  FlutterNativeLog flutterNativeLog = new FlutterNativeLog();

  @override
  initState() {
    super.initState();
    //set you are in production or in debug once
    flutterNativeLog.setIsProduction(isProduction: false);

    printLogs();
  }

  void printLogs() {

    //Start logging
    flutterNativeLog.w(tag: "Karthik", msg: "This is Test Warning"); // logType = warning
    flutterNativeLog.e(tag: "Karthik", msg: "This is Test Error"); // logType = error
    flutterNativeLog.d(tag: "Karthik", msg: "This is Test Debug"); // logType = debug
    flutterNativeLog.i(tag: "Karthik", msg: "This is Test Info"); // logType = debug
    flutterNativeLog.v(tag: "Karthik", msg: "This is Test Verbose"); // logType = debug
    flutterNativeLog.wtf(tag: "Karthik", msg: "This is Test WTF"); // logType = debug

  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: new Container(
          child: new Column(
            children: <Widget>[
              new Padding(
                padding: const EdgeInsets.all(20.0),
                child: new Text('Running'),
              ),
              new Padding(
                child: new SecondClass(),
                  padding: EdgeInsets.all(20.0)
              )
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_native_log: ^0.3.0

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_native_log/flutter_native_log.dart';
  
Version Uploaded Documentation Archive
0.3.0 Apr 24, 2018 Go to the documentation of flutter_native_log 0.3.0 Download flutter_native_log 0.3.0 archive
0.2.0 Apr 22, 2018 Go to the documentation of flutter_native_log 0.2.0 Download flutter_native_log 0.2.0 archive
0.1.0 Apr 22, 2018 Go to the documentation of flutter_native_log 0.1.0 Download flutter_native_log 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
70
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The description is too short. (-20 points)

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

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