bwu_log 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 73

BWU Log

BWU Log is a fork of Quiver log. It is a set of logging utilities that make it easy to configure and manage Dart's built in logging capabilities.

The Basics

Dart's built-in logging utilities are fairly low level. This means each time you start a new project you have to copy/paste a bunch of logging configuration code to setup output locations and logging formats. BWU Log provides a set of higher-level abstractions to make it easier to get logging setup correctly. Specifically, there are two new concepts: appender and formatter. Appenders define output locations like the console, http or even in-memory data structures that can store logs. Formatters, as the name implies, allow for custom logging formats.

Here is a simple example that sets up a InMemoryAppender with a SimpleStringFormatter:

import 'package:logging/logging.dart';
import 'package:bwu_log/log.dart';

class SimpleStringFormatter implements FormatterBase<String> {
  String call(LogRecord record) => record.message;
}

main() {
  var logger = new Logger('bwu.TestLogger');
  var appender = new InMemoryListAppender(new SimpleStringFormatter());
  appender.attachLogger(logger);
}

That's all there is to it!

BWU Log provides three Appenders: PrintAppender which uses Dart's print statement to write to the console, InMemoryListAppender which writes logs to a simple list (this can be useful for debugging or testing). Additionally, a single Formatter called BasicLogFormatter is included and uses a "MMyy HH:mm:ss.S" format. Of course there is no limit to what kind of appenders you can create, we have plans to add appenders HTTP, WebSocket, DOM, Isolate and SysOut.

To create a new kind of Appender simply extends Appender. To create a new Formatter just implement the Formatter typedef or FormatterBase class if you need to hold state in your formatter. Take a look at PrintAppender and BasicLogFormatter for an example.

0.1.1

  • add simple default initialization for the PrintAppender with setup_print_appender.dart

0.1.0

  • remove Polymer component and dependency
  • upgrade dependencies

1. Depend on it

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


dependencies:
  bwu_log: "^0.1.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bwu_log/bwu_log.dart';
        
Version Uploaded Documentation Archive
0.1.2 Apr 25, 2016 Go to the documentation of bwu_log 0.1.2 Download bwu_log 0.1.2 archive
0.1.1 Apr 25, 2016 Go to the documentation of bwu_log 0.1.1 Download bwu_log 0.1.1 archive
0.1.0 Apr 11, 2016 Go to the documentation of bwu_log 0.1.0 Download bwu_log 0.1.0 archive
2.0.0-alpha.2 Feb 14, 2017 Go to the documentation of bwu_log 2.0.0-alpha.2 Download bwu_log 2.0.0-alpha.2 archive
2.0.0-alpha.1 Feb 13, 2017 Go to the documentation of bwu_log 2.0.0-alpha.1 Download bwu_log 2.0.0-alpha.1 archive
2.0.0-alpha.0 Feb 13, 2017 Go to the documentation of bwu_log 2.0.0-alpha.0 Download bwu_log 2.0.0-alpha.0 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
77 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
22 / 100
Overall score:
Weighted score of the above. [more]
73

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:bwu_log/bwu_log.dart.

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-v1 release.

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

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use bwu_log.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.12.0 <2.0.0
intl ^0.12.7 0.12.7+1 0.15.2
logging ^0.11.0 0.11.3+1
path ^1.1.0 1.5.1
Transitive dependencies
analyzer 0.27.6 0.31.0+1
args 0.13.7 1.3.0
async 2.0.3
charcode 1.1.1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
glob 1.1.5
html 0.13.2+2
isolate 0.2.3 1.1.0
matcher 0.12.1+4
package_config 1.0.3
petitparser 1.7.0
plugin 0.2.0+2
source_span 1.4.0
stack_trace 1.9.1
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
yaml 2.1.13
Dev dependencies
bwu_grinder_tasks ^0.1.0-dev
grinder ^0.8.0+2
mock ^0.12.0
test ^0.12.0