https://github.com/dotupnet/dotup_flutter_logger
https://github.com/dotupnet/dotup_flutter_logger
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dotupnet/dotup_flutter_logger
- Owner: dotupNET
- License: gpl-3.0
- Created: 2021-07-30T06:03:24.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T09:53:02.000Z (about 1 year ago)
- Last Synced: 2025-01-09T07:46:30.155Z (6 months ago)
- Language: Dart
- Size: 19.8 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# dotup_flutter_logger
## Take a look at [dotup.de](https://dotup.de) or on [pub.dev](https://pub.dev/packages?q=dotup)
Flutter widgets for [dotup_dart_logger](https://github.com/dotupNET/dotup_dart_logger)
## Example with SqfLite
```dart
Future 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);
}}
```