{"id":27253657,"url":"https://github.com/nanofuxion/relog-rsbuild-plugin","last_synced_at":"2026-02-19T00:03:15.804Z","repository":{"id":286934563,"uuid":"963020510","full_name":"nanofuxion/relog-rsbuild-plugin","owner":"nanofuxion","description":"🪵 Capture console logs from your LynxJS app and view them directly in your terminal — designed for use with the LynxJS Native App Framework and `rsbuild`.","archived":false,"fork":false,"pushed_at":"2025-04-09T05:18:09.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T10:05:18.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nanofuxion.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2025-04-09T03:16:51.000Z","updated_at":"2025-04-09T09:05:38.000Z","dependencies_parsed_at":"2025-04-09T04:33:43.318Z","dependency_job_id":null,"html_url":"https://github.com/nanofuxion/relog-rsbuild-plugin","commit_stats":null,"previous_names":["nanofuxion/relog-rsbuild-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nanofuxion/relog-rsbuild-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanofuxion%2Frelog-rsbuild-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanofuxion%2Frelog-rsbuild-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanofuxion%2Frelog-rsbuild-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanofuxion%2Frelog-rsbuild-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanofuxion","download_url":"https://codeload.github.com/nanofuxion/relog-rsbuild-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanofuxion%2Frelog-rsbuild-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29599338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T22:25:43.180Z","status":"ssl_error","status_checked_at":"2026-02-18T22:25:42.766Z","response_time":162,"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":[],"created_at":"2025-04-11T02:00:35.491Z","updated_at":"2026-02-19T00:03:15.787Z","avatar_url":"https://github.com/nanofuxion.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Rsbuild Plugins"],"readme":"# relog-rsbuild-plugin\n\n\u003e 🪵 Capture console logs from your LynxJS app and view them directly in your terminal — designed for use with the **LynxJS Native App Framework** and `rsbuild`.\n\nThis plugin allows you to intercept `console.log()` and `console.info()` calls from your LynxJS app running on a device or emulator and send them back to the `rsbuild` dev server where they're printed in your terminal. It's especially useful for debugging native apps where logs might not show up in your local console.\n\n---\n\n\u003e ⚠️ **Disclaimer:** This README and plugin were generated with the help of AI and may contain errors or outdated assumptions.  \n\u003e 💡 I'm **not affiliated with LynxJS or its maintainers** — this project was built independently for use within the LynxJS ecosystem.  \n\u003e  \n\u003e 🙏 **Pull requests are welcome!** If something doesn’t work or could be improved, feel free to open a PR.\n\n---\n\n## 🔗 Related Plugin\n\nThis plugin is designed to work **alongside** [`ngrok-rsbuild-plugin`](https://www.npmjs.com/package/ngrok-rsbuild-plugin). It uses the ngrok tunnel URL to forward logs from remote devices when testing on real hardware.\n\nMake sure you’re using both together for the best experience.\n\n---\n\n## ✨ Features\n\n- 🔌 Adds a `POST /console_log` route to the dev server for capturing logs\n- 📄 Automatically generates a `console.js` file that overrides `console.log` and `console.info`\n- 🌐 Uses `ngrok` (if available) to allow logs from remote devices\n- ⚙️ Filters out noisy logs (like `[rspeedy-dev-server]` and `[HMR]`) by default\n- 🧪 Optional `rspeedyLogs` flag to include all logs if needed\n\n---\n\n## 🛠 Installation\n\n```bash\nnpm install relog-rsbuild-plugin --save-dev\n```\n\n---\n\n## 🔧 Setup\n\n```ts\n// rsbuild.config.ts or index.ts\nimport { pluginRelog } from 'relog-rsbuild-plugin';\n\nexport default {\n  plugins: [\n    pluginRelog({\n      rspeedyLogs: false, // set to true if you want to see all logs including [rspeedy] and [HMR]\n    }),\n  ],\n};\n```\n\n---\n\n## 📁 Output\n\nThis plugin will generate a file called `console.js` in the same directory as the plugin.  \nYou should load this file into your app's entry point (or however your framework handles native-side injection of JavaScript code).\n\n```js\nimport 'relog-rsbuild-plugin/console.js';\n```\n\n\u003e This script overrides `console.log` and `console.info` globally to forward logs to the dev server.\n\n---\n\n## 🧩 How it Works\n\n1. If `ngrok-rsbuild-plugin` is installed and exposes a tunnel URL, that URL is used for logging.\n2. A `console.js` file is generated pointing to `http(s)://\u003chost\u003e/console_log`.\n3. The script redefines `console.log` and `console.info` to send logs as JSON to the dev server.\n4. The server receives and prints them in your terminal.\n\n---\n\n## 🔍 Notes\n\n- Logs are filtered by default to hide common development spam (`[rspeedy-dev-server]`, `[HMR]`) — you can turn them back on with `rspeedyLogs: true`.\n- The server route is mounted at `/console_log`.\n- Make sure your app loads the generated `console.js` file.\n\n---\n\n## 🧪 Example Output\n\n```bash\n[APP]: App launched on device\n[APP]: Fetching data from API...\n[APP]: { status: \"ok\", data: [...] }\n```\n\n---\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanofuxion%2Frelog-rsbuild-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanofuxion%2Frelog-rsbuild-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanofuxion%2Frelog-rsbuild-plugin/lists"}