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
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.
64Compare
Works with
Packages commonly used together with logging: ones it builds on, ones built on it, and its own family.
- coverageBuilt on loggingCollects, manipulates, and formats code coverage data in Dart
- hooksBuilt on loggingDart API for the JSON-based protocol for package build and link hooks.
- code_assetsBuilt on loggingProvides the hook protocol specification for bundling native code with Dart packages.
- webkit_inspection_protocolBuilt on loggingA client for the Chrome DevTools Protocol to talk to debuggers.
- browser_launcherBuilt on loggingProvides a standardized way to launch web browsers for testing and tools.
- sseBuilt on loggingBidirectional Server Sent Events client and server for Dart.
- completionBuilt on loggingAdds shell command completion support to Dart console apps.
- objective_cBuilt on loggingSupport library for accessing Objective C via ffigen in Flutter