isolate_logger 1.0.14
isolate_logger: ^1.0.14 copied to clipboard
A logger utility that uses Isolates under the hood, that logs messages to the console and files, helping users track user events, exceptions, and other relevant activities.
IsolateLogger #
Supported Platforms.
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.
Features : #
- Console Logging: Easily log messages directly into the console for real-time monitoring and debugging.
- File Logging: Store log messages in files for persistent tracking and analysis, helping you identify patterns and potential problems.
- Isolate Support: Isolate Logger supports logging in Flutter isolates, making it suitable for applications with complex asynchronous workflows.
- Customization: Configure log levels, formats, and file storage locations according to your specific needs.
- Custom File Logging: Log messages as-is into your own files at any relative path (e.g.
service_info/login_api_123.log) — ideal for per-feature or per-request log files. - Disposal Mechanism: Which helps to clear all references to prevent any memory leak.
- Logs cleanup for specific date Which helps users to setup auto cleanup service after some specific period of time.
Screenshots : #
| Overview | Event logging | Custom file logging |
|---|---|---|
![]() |
![]() |
![]() |
| Organized log files | Export & share |
|---|---|
![]() |
![]() |
Installation : #
To use IsolateLogger in your Flutter project, add the following dependency to your pubspec.yaml file:
dependencies:
isolate_logger: any
Usage : #
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);
Logger message types : #
- Information :
any information like app events/navigation info etc - Warning :
any warnings that needs to be logged - Error :
any error or exception - also has stackTrace as optional param - Severe :
any severe exception - with mandatory stackTrace to log
💡 Feedback & Contributions #
I’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! 🚀




