{"id":21920864,"url":"https://github.com/komodoplatform/dragon_logs_flutter","last_synced_at":"2025-08-25T10:04:54.446Z","repository":{"id":201036430,"uuid":"706827461","full_name":"KomodoPlatform/dragon_logs_flutter","owner":"KomodoPlatform","description":"A lightweight, high-throughput cross-platform logging framework for Flutter with persisted log storage.","archived":false,"fork":false,"pushed_at":"2025-02-14T23:04:50.000Z","size":360,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-15T00:19:05.153Z","etag":null,"topics":["dart","flutter","logging"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/dragon_logs","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KomodoPlatform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-18T17:36:34.000Z","updated_at":"2025-02-14T23:04:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a0075cd-3a69-407b-9856-04a8db9cbca7","html_url":"https://github.com/KomodoPlatform/dragon_logs_flutter","commit_stats":null,"previous_names":["komodoplatform/dragon_logs_flutter"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KomodoPlatform%2Fdragon_logs_flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KomodoPlatform%2Fdragon_logs_flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KomodoPlatform%2Fdragon_logs_flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KomodoPlatform%2Fdragon_logs_flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KomodoPlatform","download_url":"https://codeload.github.com/KomodoPlatform/dragon_logs_flutter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244944532,"owners_count":20536291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","logging"],"created_at":"2024-11-28T20:17:27.255Z","updated_at":"2025-08-25T10:04:54.431Z","avatar_url":"https://github.com/KomodoPlatform.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚚 Repository Moved\n\n\u003e **⚠️ This repository has been migrated to the Komodo DeFi SDK Flutter monorepo.**\n\u003e\n\u003e 📍 **New location:** [packages/dragon_logs_flutter](https://github.com/KomodoPlatform/komodo-defi-sdk-flutter/tree/main/packages/dragon_logs_flutter)\n\u003e\n\u003e 🔄 **Active development** continues in the monorepo. Please update your forks, bookmarks, and links.\n\u003e\n\u003e 💡 **For issues, PRs, and contributions**, please use the [main monorepo](https://github.com/KomodoPlatform/komodo-defi-sdk-flutter).\n\n---\n\n# Dragon Logs (Archived)\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pub.dev/packages/dragon_logs\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/dragon_logs.svg\" alt=\"Pub\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA lightweight, high-throughput cross-platform logging framework for Flutter with persisted log storage.\n\n[![Komodo Platform Logo](https://komodoplatform.com/assets/img/logo-dark.webp)](https://github.com/KomodoPlatform)\n\n## Overview\n\nDragon Logs aims to simplify the logging and log storage process in your Flutter apps by ensuring it's efficient, easy to use, and uniform across different platforms. With its high-performance novel storage method for web, OPFS, Dragon Logs stands out as a modern solution for your logging needs.\n\n## Roadmap\n\n- ✅ Cross-platform log storage\n- ✅ Cross-platform logs download\n- ⬜ Flutter web wasm support\n- ⬜ Web multi-threading support\n- ⬜ Log levels (e.g. debug, info, warning, error)\n- ⬜ Performance metrics (in progress)\n- ⬜ Compressed file export\n- ⬜ Dev environment configurable logging filters for console\n- ⬜ Stacktrace formatting\n- ⬜ Log analytics\n\nYour feedback and contributions to help achieve these features would be much appreciated!\n\n## Installation\n\nTo use Dragon Logs, add it as a dependency in your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  dragon_logs: ^1.0.4\n```\n\nThen, run:\n\n```\nflutter pub get\n```\n\n# Dragon Logs API Documentation and Usage\n\nDragon Logs is a lightweight, high-throughput logging framework designed for Flutter applications. This document provides an overview of the main API and usage instructions to help developers quickly integrate and use the package in their Flutter applications.\n\n## API Overview\n\n### Initialization\n\n#### `init()`\n\nInitialize the logger. This method prepares the logger for use and ensures any old logs beyond the set maximum storage size are deleted.\n\nThis method must be called after Widget binding has been initialized and before logging is attempted.\n\nUsage:\n\n```dart\nawait DragonLogs.init();\n```\n\n### Metadata Management\n\n#### `setSessionMetadata(Map\u003cString, dynamic\u003e metadata)`\n\nSet session metadata that can be attached to logs. This is useful for attaching session-specific information such as user IDs, device information, etc.\n\nUsage:\n\n```dart\nDragonLogs.setSessionMetadata({\n  'userID': '12345',\n  'device': 'Pixel 4a',\n  'appVersion': '1.0.0'\n});\n```\n\n#### `clearSessionMetadata()`\n\nClear any session metadata that was previously set.\n\nUsage:\n\n```dart\nDragonLogs.clearSessionMetadata();\n```\n\n### Logging\n\n#### `log(String message, [String key = 'LOG'])`\n\nLog a message with an optional key. The message will be stored with any session metadata that's currently set.\n\nUsage:\n\n```dart\nlog('This is a sample log message.');\nlog('User logged in', 'USER_ACTION');\n```\n\n### Exporting Logs\n\n#### `exportLogsStream() -\u003e Stream\u003cString\u003e`\n\nGet a stream of all stored logs. This is useful if you want to process logs in a streaming manner, e.g., for streaming uploads.\n\nThe stream events do not guarantee a uniform payload. Some events may contain a single log entry or a split log entry, while others may contain the entire log history for a given day. Appending all events to a single string (without any separators) represents the entire log history as is stored on the device.\n\n**NB**: The stream will not emit any logs that are added after the stream is created and it completes after emitting all stored logs.\n\n**NB**: It is highly recommended to not use **toList()** or store the entire stream in memory for extremely large log histories as this may cause memory issues. Prefer using lazy iterables where possible.\n\nUsage:\n\n```dart\n  final logsStream = DragonLogs.exportLogsStream();\n\n  File file = File('${getApplicationCacheDirectory}}/output.txt');\n\n  file = await file.exists() ? file : await file.create(recursive: true);\n\n  final logFileSink = file.openWrite(mode: FileMode.append);\n\n  for (final log in await logsStream) {\n    logFileSink.writeln(log);\n  }\n\n  await logFileSink.close();\n```\n\n#### `exportLogsString() -\u003e Future\u003cString\u003e`\n\nGet all stored logs as a single concatenated string.\n\n**NB**: This method is not recommended for extremely large log histories as it may cause memory issues. Prefer using the stream-based API where possible.\n\nUsage:\n\n```dart\nfinal logsString = await DragonLogs.exportLogsString();\nprint(logsString);\n```\n\n#### `exportLogsToDownload() -\u003e Future\u003cvoid\u003e`\n\nExport the stored logs, preparing them for download. The exact behavior may vary depending on platform specifics. The files are stored in the app's documents directory. On non-web platforms, the files are exported using the system's save-as or share dialog. On web, the files are downloaded to the default downloads directory.\n\nUsage:\n\n```dart\nawait DragonLogs.exportLogsToDownload();\n```\n\n### Utilities\n\n#### `getLogFolderSize() -\u003e Future\u003cint\u003e`\n\nGet the current size of the log storage folder in bytes. This excludes generated export files.\n\nUsage:\n\n```dart\nfinal sizeInBytes = await DragonLogs.getLogFolderSize();\nprint('Log folder size: $sizeInBytes bytes');\n```\n\n#### `perfomanceMetricsSummary -\u003e String` (COMING SOON)\n\nGet a summary of the logger's performance metrics.\n\nUsage:\n\n```dart\nfinal metricsSummary = DragonLogs.perfomanceMetricsSummary;\nprint(metricsSummary);\n```\n\n## Contributing\n\nDragon Logs welcomes contributions from the community. Whether it's a bug report, feature suggestion, or a code contribution, we value all feedback. Please read the [CONTRIBUTING.md](link_to_contributing.md) file for detailed instructions.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](link_to_license_file) file for more details.\n\n---\n\nMade with ❤️ by [KomodoPlatform](https://github.com/KomodoPlatform)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomodoplatform%2Fdragon_logs_flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomodoplatform%2Fdragon_logs_flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomodoplatform%2Fdragon_logs_flutter/lists"}