{"id":34553230,"url":"https://github.com/t0uh33d/code_scout_flutter","last_synced_at":"2026-05-27T00:32:24.758Z","repository":{"id":282235334,"uuid":"947894390","full_name":"t0uh33d/code_scout_flutter","owner":"t0uh33d","description":"A lightweight, open-source logging and network inspection SDK for Flutter.","archived":false,"fork":false,"pushed_at":"2026-03-14T23:26:05.000Z","size":1196,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-15T08:57:17.854Z","etag":null,"topics":["analytics","debugging","flutter","logging","network-logger","open-source","telemetrics"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/code_scout","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/t0uh33d.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-03-13T12:18:07.000Z","updated_at":"2026-03-14T23:28:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"47cd8355-619a-4a95-922c-efd63f27c00f","html_url":"https://github.com/t0uh33d/code_scout_flutter","commit_stats":null,"previous_names":["t0uh33d/code_scout_flutter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/t0uh33d/code_scout_flutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0uh33d%2Fcode_scout_flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0uh33d%2Fcode_scout_flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0uh33d%2Fcode_scout_flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0uh33d%2Fcode_scout_flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t0uh33d","download_url":"https://codeload.github.com/t0uh33d/code_scout_flutter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0uh33d%2Fcode_scout_flutter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33545458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["analytics","debugging","flutter","logging","network-logger","open-source","telemetrics"],"created_at":"2025-12-24T08:17:44.150Z","updated_at":"2026-05-27T00:32:24.276Z","avatar_url":"https://github.com/t0uh33d.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/pim_code_scout.svg\" alt=\"Code Scout\" width=\"320\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A lightweight, open-source logging and network inspection SDK for Flutter.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pub.dev/packages/code_scout\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/code_scout.svg\" alt=\"pub.dev\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pub.dev/packages/code_scout_dio\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/code_scout_dio.svg?label=code_scout_dio\" alt=\"code_scout_dio\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pub.dev/packages/code_scout_http\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/code_scout_http.svg?label=code_scout_http\" alt=\"code_scout_http\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://codescout.tech\"\u003eWebsite\u003c/a\u003e \u0026middot;\n  \u003ca href=\"https://pub.dev/packages/code_scout\"\u003epub.dev\u003c/a\u003e \u0026middot;\n  \u003ca href=\"https://github.com/t0uh33d/code_scout_flutter\"\u003eGitHub\u003c/a\u003e \u0026middot;\n  \u003ca href=\"https://github.com/t0uh33d/code_scout\"\u003eServer\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nCapture logs and network calls locally, then sync them to a self-hosted [Code Scout dashboard](https://github.com/t0uh33d/code_scout) for browsing, filtering, and real-time monitoring.\n\n## Features\n\n- **Structured logging** with levels (debug, info, warning, error, fatal), tags, and metadata\n- **Network interception** for Dio and `http` — correlates request, response, and error by request ID\n- **Local persistence** in SQLite so logs survive app restarts\n- **Automatic batch sync** — compresses logs to tar.gz and uploads on a configurable interval\n- **Zero third-party HTTP deps** — all server communication uses `dart:io`\n- **Floating overlay** for quick access to connection controls during development\n- **Lightweight** — designed to add minimal overhead to your app\n\n## Packages\n\n| Package | Description | pub.dev |\n|---------|-------------|---------|\n| [code_scout](https://pub.dev/packages/code_scout) | Core logging SDK | [![pub.dev](https://img.shields.io/pub/v/code_scout.svg)](https://pub.dev/packages/code_scout) |\n| [code_scout_dio](https://pub.dev/packages/code_scout_dio) | Dio interceptor | [![pub.dev](https://img.shields.io/pub/v/code_scout_dio.svg)](https://pub.dev/packages/code_scout_dio) |\n| [code_scout_http](https://pub.dev/packages/code_scout_http) | HTTP client wrapper | [![pub.dev](https://img.shields.io/pub/v/code_scout_http.svg)](https://pub.dev/packages/code_scout_http) |\n\n## Getting Started\n\nInstall the core package:\n\n```bash\nflutter pub add code_scout\n```\n\nFor network interception, add the companion package for your HTTP client:\n\n```bash\n# For Dio users\nflutter pub add code_scout_dio\n\n# For http users\nflutter pub add code_scout_http\n```\n\n## Usage\n\n### Initialize\n\nCall `init()` early in your app (e.g. after the first frame):\n\n```dart\nimport 'package:code_scout/code_scout.dart';\n\nawait CodeScout.instance.init(\n  freshContextFetcher: () =\u003e context,\n  configuration: CodeScoutConfiguration(\n    logging: LoggingBehavior(minimumLevel: LogLevel.all),\n    projectCredentials: ProjectCredentials(\n      link: 'http://your-server:24275/',\n      projectID: 'your-project-id',\n      projectSecret: 'your-project-secret',\n    ),\n    sync: LogSyncBehavior(\n      syncInterval: Duration(seconds: 30),\n      maxBatchSize: 100,\n    ),\n  ),\n);\n```\n\n### Log messages\n\nUse the shorthand methods for quick logging:\n\n```dart\nfinal scout = CodeScout.instance;\n\nscout.d('Fetching user profile');                       // debug\nscout.i('User signed in', tags: {'auth'});              // info\nscout.w('Cache miss', metadata: {'key': 'user_prefs'}); // warning\nscout.e('Payment failed', error: e, stackTrace: st);    // error\nscout.f('Unrecoverable state');                          // fatal\nscout.v('Detailed trace data');                          // verbose\n```\n\nYou can also use the full form when you need to specify the level dynamically:\n\n```dart\nCodeScout.instance.log(\n  level: LogLevel.info,\n  message: 'User signed in',\n  tags: {'auth'},\n  metadata: {'userId': '123'},\n);\n\n// Awaitable (if you need to confirm persistence)\nawait CodeScout.instance.logMessage(\n  level: LogLevel.error,\n  message: 'Payment failed',\n  error: exception,\n  stackTrace: stackTrace,\n);\n```\n\n### Capture network calls\n\nNetwork interception is provided through separate companion packages so the core SDK stays dependency-free. Each package is a one-liner to set up.\n\n#### Dio\n\nAdd `code_scout_dio` to your dependencies, then attach the interceptor:\n\n```dart\nimport 'package:code_scout_dio/code_scout_dio.dart';\n\nfinal dio = Dio();\ndio.interceptors.add(CodeScoutDioInterceptor());\n```\n\nEvery request, response, and error flowing through this Dio instance will be automatically captured.\n\n#### http\n\nAdd `code_scout_http` to your dependencies, then wrap your client:\n\n```dart\nimport 'package:code_scout_http/code_scout_http.dart';\nimport 'package:http/http.dart' as http;\n\nfinal client = CodeScoutHttpClient(client: http.Client());\n\n// Use it like a normal http.Client\nfinal response = await client.get(Uri.parse('https://api.example.com/data'));\n```\n\n`CodeScoutHttpClient` extends `http.BaseClient`, so it's a drop-in replacement anywhere you use `http.Client`.\n\n#### How it works\n\nBoth interceptors call `NetworkManager.i.processNetworkRequest/Response/Error()` under the hood. Each network call gets a unique `requestId` that correlates the request, response, and error phases together, giving you a complete picture of every API call.\n\n### Overlay controls\n\n```dart\nCodeScout.instance.showIcon();   // Show floating button\nCodeScout.instance.hideIcon();   // Hide it\nCodeScout.instance.toggleIcon(); // Toggle\n```\n\n### Cleanup\n\n```dart\nawait CodeScout.instance.dispose();\n```\n\n## How It Works\n\n```\nFlutter App                                Code Scout Server\n┌─────────────────────────┐               ┌─────────────────────────┐\n│ CodeScout.log()         │               │                         │\n│ NetworkManager          │               │  POST /api/logs/dump    │\n│         |               │               │    (multipart tar.gz)   │\n│ LogPersistenceService   │  periodic     │         |               │\n│   (SQLite)              │──sync───────\u003e │  Log ingestion          │\n│         |               │  tar.gz       │         |               │\n│ LogSyncWorker           │  X-Project-ID │  MySQL storage          │\n│ LogCompressor (isolate) │               │         |               │\n└─────────────────────────┘               │  Web Dashboard          │\n                                          └─────────────────────────┘\n```\n\n1. Logs are written to a local SQLite database\n2. A periodic timer picks up unsync'd logs, marks them as syncing, compresses them in a background isolate, and uploads via `dart:io`\n3. On success, logs are deleted locally. On failure, they're rolled back and retried next cycle\n4. After 5 consecutive failures the sync worker stops automatically to avoid battery drain\n\n## Configuration\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `LoggingBehavior.minimumLevel` | `LogLevel.info` | Minimum level to capture |\n| `LoggingBehavior.enabledTags` | `{'*'}` | Tags to capture (`*` = all) |\n| `LoggingBehavior.printToConsole` | `true` in debug | Print logs to console |\n| `LoggingBehavior.includeCurrentStackTrace` | `false` | Attach stack trace to every log |\n| `LogSyncBehavior.syncInterval` | 5 minutes | How often to sync |\n| `LogSyncBehavior.maxBatchSize` | 100 | Max logs per upload |\n\n## Server Setup\n\nCode Scout needs a self-hosted server to receive logs. See the [code-scout](https://github.com/t0uh33d/code_scout) repo for setup instructions.\n\n```bash\n# Create a project (returns project_id and secret)\ncurl -X POST http://localhost:24275/api/project \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"My App\", \"description\": \"Production logs\"}'\n```\n\nUse the returned `project_id` and `secret_key` in your `ProjectCredentials`.\n\n## Contributing\n\nContributions are welcome! This is a free and open-source project.\n\n1. Fork the repo\n2. Create a feature branch (`git checkout -b feature/my-feature`)\n3. Make your changes and run `flutter analyze` to ensure there are no issues\n4. Submit a pull request\n\n## License\n\nThis project is open source. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0uh33d%2Fcode_scout_flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft0uh33d%2Fcode_scout_flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0uh33d%2Fcode_scout_flutter/lists"}