notice 2.0.2 copy "notice: ^2.0.2" to clipboard
notice: ^2.0.2 copied to clipboard

An extensible logger with an intuitive tree-like structure. Notice excels in seamless cross-package logging while offering a simple yet robust API for developers.

example/notice_example.dart

import 'package:notice/filters.dart';
import 'package:notice/notice.dart';
import 'package:notice/outputs.dart';
import 'package:notice/registry.dart';

void main() {
  final notice = Notice(
    outputs: [
      FilteredOutput(
        LevelFilter(NoticeLevel.info),
        ConsoleOutput.simple(),
      ),
    ],
    registries: [globalNoticeRegistry],
  );
  notice.info("Hello World");
  notice.trace("Will not be logged");

  final subNotice = Notice(parent: notice);
  subNotice.info("Hello World pt. 2");

  final thirdPartyNotice =
      Notice(parent: globalNoticeRegistry, breadcrumb: "FooPackage");
  thirdPartyNotice.error("Hello World from another package");

  final thirdPartySubPackage =
      Notice(parent: thirdPartyNotice, breadcrumb: "BarProcessing");
  thirdPartySubPackage.warn("Sub log from another package");
}
9
likes
140
pub points
46%
popularity

Publisher

unverified uploader

An extensible logger with an intuitive tree-like structure. Notice excels in seamless cross-package logging while offering a simple yet robust API for developers.

Repository (GitLab)
View/report issues

Topics

#logging #logger #notice

Documentation

API reference

License

MIT (LICENSE)

Dependencies

ansicolor, fast_immutable_collections, meta, stack_trace

More

Packages that depend on notice