Skip to main content

cobalt_logger 1.7.0 copy "cobalt_logger: ^1.7.0" to clipboard
cobalt_logger: ^1.7.0 copied to clipboard

Cobalt adapter for package:logger — sends the DI graph's events to a Logger with its pretty console output.

cobalt_logger #

Adapter for package:logger — the one with the boxed console output — for Cobalt.

Not cobalt_logging. That adapts package:logging, the dart.dev package whose name differs by one letter.

final scope = await CobaltApplication.start(
  root: const AppScope(),
  observers: [CobaltLogObserver(CobaltLoggerSink())],
);

Unlike package:logging, this one prints by itself: the default Logger already has a console output and PrettyPrinter. Pass your own if you have configured one.

Levels #

Cobalt's five map one-to-one onto trace, debug, info, warning, error. None of them can land on Level.all, Level.off or Level.nothing, which matters because Logger.log throws ArgumentError on those — a test in this package pins it.

0
likes
160
points
1.54k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Cobalt adapter for package:logger — sends the DI graph's events to a Logger with its pretty console output.

Repository (GitHub)
View/report issues
Contributing

Topics

#dependency-injection #di #logging #observability

License

MIT (license)

Dependencies

cobalt, logger

More

Packages that depend on cobalt_logger