dart_seq_hive_cache 1.0.0 copy "dart_seq_hive_cache: ^1.0.0" to clipboard
dart_seq_hive_cache: ^1.0.0 copied to clipboard

An extension for `dart_seq` that provides a local database for log events using Hive

GitHub License Pub Version Pub Points Pub Likes Pub Popularity

An extension for dart_seq that provides a local database for log events using Hive.

Features #

  • Provides an implementation of SeqCache from dart_seq
  • Stores events on disk until flush is called on the logger
  • Preserves events between sessions (useful for troubleshooting)

Getting started #

Install both dart_seq and dart_seq_hive_cache:

dart pub add dart_seq dart_seq_hive_cache

Usage #

final cache = await SeqHiveCache.create();

final logger = SeqLogger.http(
  host: "http://localhost:5341",
  cache: cache,
);

await logger.log(SeqLogLevel.information, "before loop");

for (var i = 0; i < 10; i++) {
  await logger.log(SeqLogLevel.information, i.toString());

  print('events in cache: ${cache.count}');

  await Future.delayed(const Duration(seconds: 1));
}

await logger.log(SeqLogLevel.information, "after loop");

await logger.flush();

Screenshot from Seq showing the result of the above code

Additional information #

Please open issues on GitHub if you want to request a feature or report a bug.

Pull requests are welcome!

1
likes
160
points
35
downloads

Publisher

verified publisherricardoboss.de

Weekly Downloads

An extension for `dart_seq` that provides a local database for log events using Hive

Repository (GitHub)
View/report issues

Topics

#logging #seq #cache #hive

Documentation

API reference

License

MIT (license)

Dependencies

dart_seq, hive

More

Packages that depend on dart_seq_hive_cache