dotup_flutter_logger_sqflite_writer 0.2.0
dotup_flutter_logger_sqflite_writer: ^0.2.0 copied to clipboard

SqfLite log writer for https://github.com/dotupNET/dotup_dart_logger

dotup_flutter_logger_sqflite_writer #

Take a look at dotup.de or on pub.dev #

Example #

Future<void> example() async {

  var dir = await getApplicationDocumentsDirectory();
  final dbFolder = dir.path;

  if (!await Directory(dbFolder).exists()) {
    await Directory(dbFolder).create(recursive: true);
  }

  final databaseFile = '$dbFolder/logging.db';

  // Initialize log writer
  final sqfLiteLogWriter = SqfLiteLogWriter(LogLevel.All);
  await sqfLiteLogWriter.initialize(databaseFile);
  // Add to logger manager
  LoggerManager.addLogWriter(sqfLiteLogWriter);

  runApp(MyApp());


  // Use it everywhere
  final logger = Logger('Nice');
  logger.warn('Oh');
  logger.info('Ah');

  // Get all entries from database
  final repo = sqfLiteLogWriter.repository;
  final all = await repo.readAll();
  for (var item in all) {
    print(item.message);
  }

}
0
likes
70
pub points
20%
popularity

Publisher

dotup.de

SqfLite log writer for https://github.com/dotupNET/dotup_dart_logger

Homepage
Repository (missing)
View/report issues

Documentation

API reference

License

GPL-3.0 (LICENSE)

Dependencies

dotup_dart_logger, flutter, sqflite, sqflite_common, sqflite_common_ffi, uuid

More

Packages that depend on dotup_flutter_logger_sqflite_writer