Skip to content
pubscout

logging

1.3.0, released 2 years ago by dart.dev

Provides configurable logging with levels and stream listeners for Dart apps.

WASM-readyQuiet but busy
$ flutter pub add logging
Source repository

What it does

The package lets you create named loggers, set hierarchical log levels, and listen to log records via streams. It supports lazy message evaluation and level change notifications.

AI-written summary of version 1.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need structured, level‑filtered logging in a Dart or Flutter project
  • You want to capture logs without adding external dependencies

Skip it when

  • You require remote log aggregation or analytics services
  • You need a UI log viewer or persistent storage

Strengths

  • Zero dependencies and BSD‑3 license
  • Fine‑grained level control and hierarchical logging
  • Stream‑based API enables custom handling

Weaknesses

  • No built‑in persistence or remote transport
  • Only provides logging, not log analysis tools

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:logging/logging.dart';

void main() {
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen((r) => print('${r.level.name}: ${r.time}: ${r.message}'));
  final log = Logger('MyClass');
  log.fine('debug message');
  log.severe('error', Exception('oops'));
}

Alternatives

Packages that do the same job and could replace logging.

  • big_decimal

    A bugless implementation of BigDecimal in Dart based on Java's BigDecimal.

Works with

Packages commonly used together with logging: ones it builds on, ones built on it, and its own family.