log4dart 1.4.19

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 39

Build Status Coverage Status

Log4Dart

Logging library with multiple appenders, configurable formatting and log tracing.

Getting Started

1. Add the folowing to your pubspec.yaml and run pub install

	dependencies:
	  log4dart: any

2. Add log4dart to some code and run it

	import "package:log4dart/log4dart.dart";
	
	main() {
		var myClass = new MyClass();
		myClass.someMethod();
	}
		
	class MyClass {
		static final _logger = LoggerFactory.getLoggerFor(MyClass);
	
		someMethod() {
			_logger.info("a info message");
			// :
			_logger.warnFormat("%s %s", ["message", "formatting"]);
		}
	}

Creating Loggers

Log4Dart is split in multiple libraries so it can run on both servers and in browsers.

// for client side logging (works both on the VM and when compiled to JS)
import "package:log4dart/log4dart.dart";

// for VM logging, allows you to log to files (does not compile to JS) 
import "package:log4dart/log4dart_vm.dart";

When you want to retrieve a logger instance you can do it in one of two ways

  1. LoggerFactory.getLoggerFor(MyClass) - logger with the fully qualified name of MyClass
  2. LoggerFactory.getLogger("MyClass") - logger with the name "MyClass"

Where the qualified name is the library name and type name concatenated together.

More Information

The configuration guide covers everything from log level setup to output formatting. For more advanced features, such as log tracing, check out the advanced feature guide.

1.4.18

  • Remove dependency on meta package

1.4.17

  • Correct copyright message

1.4.16

  • Bump dependencies

1.4.15

  • Rewrite tests to gain better code coverage

1.4.14

  • Further fixes to organize project to work with Travis CI

1.4.13

  • Switch to Travis CI

1.4.12

  • Switch to new Dart test library

1.4.11

  • Add changelog

1. Depend on it

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


dependencies:
  log4dart: "^1.4.19"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:log4dart/log4dart.dart';
        
Version Uploaded Documentation Archive
1.4.19 Apr 19, 2016 Go to the documentation of log4dart 1.4.19 Download log4dart 1.4.19 archive
1.4.18 Feb 1, 2016 Go to the documentation of log4dart 1.4.18 Download log4dart 1.4.18 archive
1.4.17 Feb 1, 2016 Go to the documentation of log4dart 1.4.17 Download log4dart 1.4.17 archive
1.4.16 Aug 4, 2015 Go to the documentation of log4dart 1.4.16 Download log4dart 1.4.16 archive
1.4.15 Jun 30, 2015 Go to the documentation of log4dart 1.4.15 Download log4dart 1.4.15 archive
1.4.14 May 23, 2015 Go to the documentation of log4dart 1.4.14 Download log4dart 1.4.14 archive
1.4.13 Mar 13, 2015 Go to the documentation of log4dart 1.4.13 Download log4dart 1.4.13 archive
1.4.12 Nov 13, 2013 Go to the documentation of log4dart 1.4.12 Download log4dart 1.4.12 archive
1.4.11 Nov 3, 2013 Go to the documentation of log4dart 1.4.11 Download log4dart 1.4.11 archive
1.4.10 Oct 23, 2013 Go to the documentation of log4dart 1.4.10 Download log4dart 1.4.10 archive

All 33 versions...

Analysis

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

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

  • tool failures 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]
13 / 100
Health:
Code health derived from static analysis. [more]
96 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
20 / 100
Overall score:
Weighted score of the above. [more]
39

Platforms

Detected platforms: web, other

Primary library: package:log4dart/log4dart.dart with components: mirrors.

Suggestions

  • Fix lib/src/logger_config.dart.

    Strong-mode analysis of lib/src/logger_config.dart failed with the following error:

    line: 64 col: 3
    Invalid override. The type of 'LoggerConfig.==' ('(LoggerConfig) → bool') isn't a subtype of 'Object.==' ('(dynamic) → bool').

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use log4dart.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.9.0 <2.0.0
sprintf ^1.0.8 1.0.8 3.0.2
Dev dependencies
test any