Loading repository data…
Loading repository data…
aliasgar4558 / repository
A lightweight & easy to use "DART" based flutter package which will help in logging app specific events locally on console & in file as well.
IsolateLogger is a dart based flutter package utility (which uses Isolates under the hood) designed to simplify logging messages into the console and files. It aids developers in tracking user events, exceptions, and other relevant information within their flutter applications.
With IsolateLogger, you can efficiently monitor your application's behavior, identify issues, and improve user experience.
service_info/login_api_123.log) — ideal for per-feature or per-request log files.| Overview | Event logging | Custom file logging |
|---|---|---|
| Organized log files | Export & share |
|---|---|
To use IsolateLogger in your Flutter project, add the following dependency to your pubspec.yaml file:
dependencies:
isolate_logger: any
import 'package:isolate_logger/isolate_logger.dart';
// Initialize the logger
await IsolateLogger.instance.initLogger(
timeFormat: LogTimeFormat.userFriendly,
logIntoFile: false,
// check for other optional params as well to customize
);
// Use this method to log info. [Check other types as well for logging effectively]
IsolateLogger.instance.logInfo(
tag: "{tag here}",
message: "{message here}",
subTag: "{sub tag here}", // optional param
);
// To log a message as-is into a custom file (relative to the app logs folder) :
// e.g. this writes into "AppLogs/service_info/login_api_123.log"
IsolateLogger.instance.logIntoCustomFile(
filePath: "service_info/login_api_123.log",
message: "{message here}",
);
// To clear all logs and its associated files :
await IsolateLogger.instance.clearAllLogs();
// To export log files as ZIP, use this :
final result = await IsolateLogger.instance.exportLogs(
exportType: LogsExportType.all, // All & Today are the options for `exportType`
logZipFilePrefix: "zipFilePrefix", // Optional prefix to be consider in zip file name.
);
// To dispose all utility references
IsolateLogger.instance.dispose();
// To clean up log files modified before the given number of days :
await IsolateLogger.instance.clearLogsBefore(3);
any information like app events/navigation info etcany warnings that needs to be loggedany error or exception - also has stackTrace as optional paramany severe exception - with mandatory stackTrace to logI’d love to hear your feedback on this package! If you encounter any bugs or have feature requests, please open an issue.
If you’d like to contribute, feel free to fork the repo, make your improvements, and submit a pull request. Let’s build something amazing together! 🚀