logs_spotter 0.1.4
logs_spotter: ^0.1.4 copied to clipboard
Spotter is an open source log engine plugin for Flutter. There allow developer to see what happen whenever or remotely debug their application
logs_spotter #
logs_spotter is an open-source log engine plugin for Flutter. It helps developers capture, view and optionally remote-debug application logs. This fork migrates remote storage from Firebase to Supabase and adds encryption for remote logs.
Highlights #
- Local console and file logging
- Optional remote storage using Supabase
- AES-256-CBC encryption for remote logs (key derived from your Supabase anon key)
- Lightweight API designed for Flutter apps
Installation #
Add the package to your pubspec.yaml:
dependencies:
logs_spotter: ^0.1.4
Then run:
flutter pub get
If you're working with the local example, the example app references the package locally via a path: dependency.
Quick usage #
Wrap your runApp in spotterScope to catch Flutter errors automatically:
await spotterScope(() async {
runApp(const MyApp());
});
Initialize Spotter (example using Supabase):
// replace with your values
await Spotter.initialize(
supabaseUrl: 'https://your-project.supabase.co',
supabaseAnonKey: 'YOUR_SUPABASE_ANON_KEY',
writeToConsole: true,
writeToFile: true,
writeToRemote: true,
);
Spotter.setUserLabel('user-123');
Log messages using convenience extensions:
// fine / debug
"goodJob".f.spot();
// info
"yourMessage".i.spot();
// error
"errorMessage".e.spot();
// add tag
"incrementCounter".c.spot(tag: 'click');
By default logs are written to console. When writeToRemote is enabled logs are encrypted before being sent to Supabase.
Migration notes (Firebase -> Supabase) #
This package previously used Firebase for remote log storage. The current version uses Supabase and encrypts remote payloads. Breaking changes:
- Remote configuration now expects
supabaseUrlandsupabaseAnonKeyinstead of Firebase configuration. initializeEnginehas been replaced bySpotter.initialize(...)and parameters names may have changed.
See example/lib/main.dart for a working example.
Publishing to pub.flutter-io.cn #
Before publishing, run a dry-run to catch metadata issues:
# for Dart packages
dart pub publish --dry-run
# or for Flutter packages
flutter pub publish --dry-run
Checklist before publishing:
- Bump
versioninpubspec.yaml(semantic versioning) - Ensure
description,homepageandrepositoryfields are set inpubspec.yaml - Remove any
publish_to: 'none'lines from packagepubspec.yaml - Make sure there are no secrets/keys in the repo or README
- Add a changelog entry for the new version
If dry-run passes and you're ready, publish normally with:
flutter pub publish
or
dart pub publish
Note: you must be logged in to pub.flutter-io.cn. Use dart pub login if needed.
Contributing #
Contributions welcome. Please open issues or PRs on the repository: https://github.com/Shek863/logs_spotter
License #
This project is licensed under the MIT License - see the LICENSE file for details.