loggable 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 68

Loggable #

Package provide simple Loggable mixin to avoid typing class name for each class.

pub package

Usage #

Without Loggable:

import 'package:logging/logging.dart';

class MyClass{
  final Logger log = Logger("MyClass");

With Loggable:

import 'package:loggable/loggable.dart';

class MyClass extends Object with Loggable {

Features and bugs #

  • There is no support for logging from the static methods. Still need to creating Logger instance by hands.

Please file feature requests and bugs at the issue tracker.

1.0.1 #

  • Do not store Logger reference in mutable private var to avoid immutable linter warning

1.0.0 #

  • Initial version


import 'package:loggable/loggable.dart';
import 'package:logging/logging.dart';

class MyClass extends Object with Loggable {
  void myMethod(){

main() {

  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((LogRecord rec) {
    print('[${rec.level.name.padRight(7)}] [${rec.loggerName.padRight(25)}] ${rec.message}');

  var myClass = MyClass();


Use this package as a library

1. Depend on it

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

  loggable: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:loggable/loggable.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
logging ^0.11.3+2 0.11.4
Dev dependencies
pedantic ^1.8.0
test ^1.6.0