notice 1.2.1 copy "notice: ^1.2.1" to clipboard
notice: ^1.2.1 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.

Notice #

Pub Points Pub Version Gitlab Pipeline Status GitLab last commit GitLab (self-managed)

Notice is 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.

Simplest example #

final notice = Notice(
  outputs: [ConsoleOutput()],
);
notice.info("Hello World");
// prints: 2023-12-11T20:00:28.495978 INFO: Hello World

Creating sub-loggers #

Always know where the message came from using breadcrumbs

final notice = Notice(outputs: [ConsoleOutput()], breadcrumb: "main");
final subNotice = Notice.childOf(notice, breadcrumb: "foo");
subNotice.info("Sub Logger message");
// prints: 2023-12-11T20:03:28.048468 main.foo INFO: Sub Logger message

Filtering messages #

If you need multiple filters you can also use CombinedFilter

final notice = Notice(outputs: [
  FilteredOutput(
    LevelFilter(NoticeLevel.info),
    ConsoleOutput(),
  ),
]);
notice.info("Will be logged");
notice.warn("Will also be logged");
notice.trace("Will not be logged");
// prints:
// 2023-12-11T20:18:26.721386 INFO: Will be logged
// 2023-12-11T20:18:26.723331 WARN: Will also be logged

Third-Party-Package logging #

Notice(
  outputs: [ConsoleOutput()],
  registries: [globalNoticeRegistry],
);
final thirdPartyPackageNotice = Notice(
  parent: globalNoticeRegistry,
  breadcrumb: "BarPackage",
);
thirdPartyPackageNotice.error("Error from another package");
// prints: 2023-12-11T20:09:51.188054 BarPackage ERROR: Error from another package

Extensible #

Create your own implementation of filters and outputs to extend the behaviour of this package

package description
notice_sentry Notice integration for sentry

Roadmap #

  • Improve output formatting
    Add colors and possibly borders to the output. This will also include a formatting interface for better code seperation and customizability.
  • Adapters to most of the common dart loggers
    To improve the experience when switching to notice and not make package authors clients dependent on it
11
likes
150
points
90
downloads

Publisher

unverified uploader

Weekly Downloads

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 #notice

Documentation

API reference

License

MIT (license)

Dependencies

fast_immutable_collections, meta

More

Packages that depend on notice