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

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

example/lib/main.dart

import 'dart:async';

import 'package:dart_seq/dart_seq.dart';
import 'package:dart_seq_hive_cache/dart_seq_hive_cache.dart';

void main() async {
  final cache = await SeqHiveCache.create();

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

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

  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();

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

  print('events in cache: ${cache.count}');
}
0
likes
0
pub points
24%
popularity

Publisher

verified publisherricardoboss.de

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

dart_seq, hive, path_provider

More

Packages that depend on dart_seq_hive_cache