https://github.com/ricardoboss/dart_seq_hive_cache
A cache implementation for dart_seq using Hive as a database
https://github.com/ricardoboss/dart_seq_hive_cache
cache dart hive seq
Last synced: 23 days ago
JSON representation
A cache implementation for dart_seq using Hive as a database
- Host: GitHub
- URL: https://github.com/ricardoboss/dart_seq_hive_cache
- Owner: ricardoboss
- License: mit
- Created: 2023-06-26T14:08:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T17:33:28.000Z (over 1 year ago)
- Last Synced: 2026-01-11T13:53:01.565Z (about 1 month ago)
- Topics: cache, dart, hive, seq
- Language: Dart
- Homepage: https://pub.dev/packages/dart_seq_hive_cache
- Size: 106 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README





An extension for [`dart_seq`](https://pub.dev/packages/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`:
```shell
dart pub add dart_seq dart_seq_hive_cache
```
## Usage
```dart
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();
```

## Additional information
Please open issues on GitHub if you want to request a feature or report a bug.
Pull requests are welcome!