{"id":28072683,"url":"https://github.com/yowainwright/logsdx","last_synced_at":"2025-06-12T02:06:14.610Z","repository":{"id":287505864,"uuid":"964856597","full_name":"yowainwright/logsdx","owner":"yowainwright","description":"log streaming with dx on the 🧠","archived":false,"fork":false,"pushed_at":"2025-05-05T10:23:07.000Z","size":188,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T02:06:08.980Z","etag":null,"topics":["log-streaming","log-streaming-cli","log-streaming-web-client","logs"],"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/yowainwright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-11T22:57:54.000Z","updated_at":"2025-05-05T10:23:10.000Z","dependencies_parsed_at":"2025-05-05T06:25:57.323Z","dependency_job_id":"ec18bb65-9460-4fa6-bb02-b61faab2756f","html_url":"https://github.com/yowainwright/logsdx","commit_stats":null,"previous_names":["yowainwright/logsx","yowainwright/logsdx"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yowainwright/logsdx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Flogsdx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Flogsdx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Flogsdx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Flogsdx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yowainwright","download_url":"https://codeload.github.com/yowainwright/logsdx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yowainwright%2Flogsdx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259382289,"owners_count":22848835,"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":["log-streaming","log-streaming-cli","log-streaming-web-client","logs"],"created_at":"2025-05-12T21:17:36.786Z","updated_at":"2025-06-12T02:06:14.583Z","avatar_url":"https://github.com/yowainwright.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003cimg alt=\"logsdx\" width=\"300\" src=\"https://github.com/user-attachments/assets/cc2a3b55-5bfd-44e8-a330-bfa146b50059\" /\u003e\u003c/div\u003e\n\n# LogsDX\n\nA flexible log visualization library that supports theming logs to be viewed in both a terminal and clients.\n\n## Why\n\nAfter dealing with inferior logs in various clients—ci, ui cloud tools, etc, a way to have the same visual aesthetic of logs in both the terminal and clients seemed necessary.\n\n#### As of, 2025-04-13, these features are planned:\n\n- [x] basic theming and theme support for piping JSON logs in a terminal\n- [x] code functionality for non-specific logs in a terminal\n- [ ] full example and importability of non-specific logs in a terminal (in progress)\n- [x] code functionality for ANSI log theming in a react client\n- [ ] full example and importability of ANSI log theming in a react client (in progress)\n- [ ] more composable way to import and treeshake features\n- [ ] documented working demo displaying the ability to add/use/create custom themes\n- [ ] documented working demo displaying the ability to add/use/create custom parsers\n- [ ] documented working demo displaying the ability to add/use/create custom clients\n- [ ] clearly documented schemas for theming and parsing\n- [ ] clearly documented way to create and use custom clients\n- [ ] improve ways to use build artifacts—only client, only cli, etc\n\n## Installation\n\n```bash\nnpm install logsdx\n```\n\n---\n\n## CLI Usage\n\nLogsDX provides a powerful command-line interface for processing and formatting logs.\n\n### Basic Usage\n\n```bash\n# Process a log file\nlogsdx input.log\n\n# Process logs from stdin\ncat input.log | logsdx\n\n# Save output to a file\nlogsdx input.log --output formatted.log\n```\n\n### Options\n\n```bash\n--debug, -d           Enable debug mode\n--output, -o \u003cfile\u003e   Path to output file\n--theme, -t \u003ctheme\u003e   Theme to use (default: \"oh-my-zsh\")\n--list-themes         List available themes\n--config, -c \u003cfile\u003e   Path to config file\n```\n\n### Examples\n\n#### List Available Themes\n\n```bash\nlogsdx --list-themes\n```\n\n#### Using a Specific Theme\n\n```bash\nlogsdx input.log --theme dark\n```\n\n#### Parse JSON Logs\n\n```bash\n# Parse a JSON log file\nlogsdx input.json --parser=json\n\n# Parse JSON logs from stdin\necho '{\"level\":\"info\",\"message\":\"Test message\",\"timestamp\":\"2023-01-01T00:00:00.000Z\"}' | logsdx --parser=json\n```\n\n#### Parse with Custom Rules\n\n```bash\n# Parse logs with custom regex rules\nlogsdx input.log --parser=regex --rules=rules.json\n```\n\n#### Filter by Log Level\n\n```bash\n# Show only warnings and errors\nlogsdx input.log --level=warn\n\n# Show only errors\nlogsdx input.log --level=error\n```\n\n#### Debug Mode\n\n```bash\n# Enable debug mode for verbose output\nlogsdx input.log --debug\n```\n\n## Client Usage\n\nLogsDX provides support for rendering styled logs in various client environments.\n\n### React Component Usage\n\n```tsx\nimport { LogViewer } from \"logsdx\";\n\nfunction App() {\n  return (\n    \u003cLogViewer\n      log={logContent}\n      theme={{\n        error: [\"red\"],\n        warn: [\"yellow\"],\n        info: [\"blue\"],\n      }}\n      outputFormat=\"html\"\n      htmlStyleFormat=\"css\"\n    /\u003e\n  );\n}\n```\n\n---\n\n## API Reference\n\n### Core API\n\n```tsx\nimport { LogsDX, getTheme, getAllThemes, getThemeNames } from \"logsdx\";\n\n// Get LogsDX instance\nconst logsDX = LogsDX.getInstance({\n  theme: \"oh-my-zsh\",\n  outputFormat: \"ansi\", // or 'html'\n  htmlStyleFormat: \"css\", // or 'className'\n  debug: false,\n});\n\n// Process a single line\nconst styledLine = logsDX.processLine(\"INFO: Application started\");\n\n// Process multiple lines\nconst styledLog = logsDX.processLog(\"INFO: Line 1\\nERROR: Line 2\");\n\n// Get available themes\nconst themeNames = getThemeNames();\nconst themes = getAllThemes();\nconst myTheme = getTheme(\"oh-my-zsh\");\n```\n\n### Themes\n\nLogsDX comes with built-in themes and supports custom themes:\n\n```tsx\n// Using a built-in theme\nconst logsDX = LogsDX.getInstance({ theme: \"oh-my-zsh\" });\n\n// Using a custom theme\nconst logsDX = LogsDX.getInstance({\n  theme: {\n    name: \"my-custom-theme\",\n    styles: {\n      error: { color: \"red\", bold: true },\n      warning: { color: \"yellow\" },\n      info: { color: \"blue\" },\n      // Add more style definitions\n    },\n    // Add pattern definitions\n  },\n});\n```\n\n---\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Install dependencies (`bun install`)\n4. Run tests (`bun test`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n### Development\n\n```bash\n# Install dependencies\nbun install\n\n# Using mise for development tasks\n# brew install mise\nmise install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyowainwright%2Flogsdx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyowainwright%2Flogsdx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyowainwright%2Flogsdx/lists"}