dotup_flutter_logger_sqflite_writer

Creator: coderz1093

Last updated:

0 purchases

dotup_flutter_logger_sqflite_writer Image
dotup_flutter_logger_sqflite_writer Images

Languages

Categories

Add to Cart

Description:

dotup flutter logger sqflite writer

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

}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.