logsinks 0.1.3

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

logsinks

pub package

Provides output targets (sinks) for log messages create by the dart logging package.

Currently supported sinks:

  • ConsoleLogSink: Writes the logger messages to the console. Different log levels are printed in different colors.

Getting Started

Add logsinks and logging to your pubspec.yaml dependencies:

...
dependencies:
  flutter:
    sdk: flutter

  logsinks: <current version>
  logging: <current version>
...

Usage

// Import the packages.
import 'package:logging/logging.dart';
import 'package:logsinks/log_sinks.dart';

void main() {
  // Configer the logger
  Logger.root.level = Level.INFO;

  // Configer a log sink to output the logger messages to the console.
  final messageSink = ConsoleLogSink();
  messageSink.attachToLogger(Logger.root);

  // Create a named logger ...
  final logger = Logger("myLogger");
  // and print "Hello World" at Level.INFO in to the console.
  logger.log(Level.INFO, "Hello World");
  // same as:
  logger.info("Hello World");

  // When you are done, dispose the sink.
  messageSink.dispose();
}

[0.1.2]

  • Fix code files layout.

[0.1.2]

  • Fixes a bug within the example.

[0.1.1]

  • Reformat code to compile to the pub spec.

[0.1.0]

  • Intitial Version.

example/main.dart

// Import the packages.
import 'package:logging/logging.dart';
import 'package:logsinks/console_log_sink.dart';

void main() {
  // Configer the logger
  Logger.root.level = Level.INFO;

  // Configer a log sink to output the logger messages to the console.
  final messageSink = ConsoleLogSink();
  messageSink.attachToLogger(Logger.root);

  // Create a named logger ...
  final logger = Logger("myLogger");
  // and print "Hello World" at Level.INFO in to the console.
  logger.log(Level.INFO, "Hello World");
  // same as:
  logger.info("Hello World");

  // When you are done, dispose the sink.
  messageSink.dispose();
}

Use this package as a library

1. Depend on it

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


dependencies:
  logsinks: ^0.1.3

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:logsinks/console_log_sink.dart';
import 'package:logsinks/log_message_sink.dart';
import 'package:logsinks/log_sinks.dart';
  
Version Uploaded Documentation Archive
0.1.3 Oct 29, 2018 Go to the documentation of logsinks 0.1.3 Download logsinks 0.1.3 archive
0.1.2 Oct 29, 2018 Go to the documentation of logsinks 0.1.2 Download logsinks 0.1.2 archive
0.1.1 Oct 29, 2018 Go to the documentation of logsinks 0.1.1 Download logsinks 0.1.1 archive
0.1.0 Oct 29, 2018 Go to the documentation of logsinks 0.1.0 Download logsinks 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
25
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]
63
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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
colorize ^2.0.0 2.0.0
flutter 0.0.0
logging ^0.11.3+2 0.11.3+2
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test