{"_id":"@baudevs/bau-log-hero","_rev":"7-3891859f9814e25b2cbfa21350f53dfb","name":"@baudevs/bau-log-hero","dist-tags":{"latest":"1.9.0"},"versions":{"1.2.0":{"name":"@baudevs/bau-log-hero","version":"1.2.0","_id":"@baudevs/bau-log-hero@1.2.0","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"dist":{"shasum":"93e10ce95a2a0a2ce291a791414e995ad4de8520","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.2.0.tgz","fileCount":18,"integrity":"sha512-zGPpX9CObxrxClYfEu+sHwmCMyvc+jKR2DCqyfuLtSN6Ox/r8kjy7F7AD7RQgElDhIeFGEMd8Tmk5swMSlROHw==","signatures":[{"sig":"MEQCIEAgdWwIg3CsM1bZ4Dl8IoD3ELNHwjcXnV9oI9COgZOJAiAZ4vXfYvmL86AWgWx7g6KT1NkJLn9cSiSGIjPO+owmDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21510},"main":"./src/index.js","type":"commonjs","gitHead":"ab5cfe2a51893392f5f4f39c76cf23a78622e3f3","typings":"./src/index.d.ts","_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"repository":{"url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero","type":"git"},"_npmVersion":"10.9.2","description":"![BauLogHero Logo](../assets/bauLogHero/BauLogHero.png)","directories":{},"_nodeVersion":"23.4.0","dependencies":{"tslib":"^2.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bau-log-hero_1.2.0_1734033739570_0.6230807262274742","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@baudevs/bau-log-hero","version":"1.2.1","_id":"@baudevs/bau-log-hero@1.2.1","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"dist":{"shasum":"caed01c3d1e3921e0000b964f2ed1b0072e55e8f","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.2.1.tgz","fileCount":18,"integrity":"sha512-uN5hIPIKPOhbFH5qvFW1k2kUuo+TEmJTGCdXP7KJIeivhE+lX62a3p85obgSVIJbcD/knXnORwt0AAEpRLTVDw==","signatures":[{"sig":"MEUCICYCZgikl76cSmcfteAsCfFsZ9asfacQVlgur7b398cfAiEAn7K9jRjjo7Ub4q4wfVa8ubX4wWO8CWfkxEroN6pnToc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22411},"main":"./src/index.js","type":"commonjs","gitHead":"8dc710f5c83d6239d34dae4a273a4ab1c91ae0f1","typings":"./src/index.d.ts","_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"repository":{"url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero","type":"git"},"_npmVersion":"10.9.2","description":"![BauLogHero Logo](../assets/bauLogHero/BauLogHero.png)","directories":{},"_nodeVersion":"23.4.0","dependencies":{"tslib":"^2.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bau-log-hero_1.2.1_1734080957169_0.8996804254011641","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@baudevs/bau-log-hero","version":"1.2.2","_id":"@baudevs/bau-log-hero@1.2.2","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"dist":{"shasum":"18de74e9040b0dc3b4b0c4d06e9ea96ac9ceb00c","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.2.2.tgz","fileCount":18,"integrity":"sha512-fpLKuaq+Hssp6R6Wi1Q2X1MihSQus1/KPYqfiJqUo0uvEMLAzpCCwp8/XbDPfg9eMDp2BpG0W50dIuwWZn+u9g==","signatures":[{"sig":"MEUCIFTGwaqfCqcEbImJO+Jo09h/Ya4lzB5HX7odEab+pApGAiEAw8vfDR+aFuHI8yy4HvPd0TM7mdGH1SLhEAbnho9zWGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22620},"main":"./src/index.js","type":"commonjs","gitHead":"2374fdce3660b5a39df4af3ce11c1cb3bdd9c6f4","typings":"./src/index.d.ts","_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"repository":{"url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero","type":"git"},"_npmVersion":"10.9.2","description":"![BauLogHero Logo](../../assets/bauLogHero/BauLogHero.png)","directories":{},"_nodeVersion":"23.4.0","dependencies":{"tslib":"^2.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bau-log-hero_1.2.2_1734081611541_0.7465456191594781","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@baudevs/bau-log-hero","version":"1.3.0","_id":"@baudevs/bau-log-hero@1.3.0","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"dist":{"shasum":"43ee75a4f5215873f944c99ef61d03ee2d0c6710","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.3.0.tgz","fileCount":18,"integrity":"sha512-k2N9HN6jJDeV/feH/H4X5bX1FMeXH0OzRe+SsCe/YFZyWbkqml3hF5HWYg81WGQI47vOvDs5jLMDIj6pRZahYA==","signatures":[{"sig":"MEYCIQCP6m9rmbm4NqJSXGjIiwcunent7I7THNfmodeXYBbahwIhANE68S8SYgXvrHClt6MwoscboNAuAsanyG4AivXtTPNL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23025},"main":"./src/index.js","type":"commonjs","gitHead":"c11d1303367cc346324fa1c8b3fc51487cdd4825","typings":"./src/index.d.ts","_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"repository":{"url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero","type":"git"},"_npmVersion":"10.9.2","description":"![BauLogHero Logo](../../assets/bauLogHero/BauLogHero.png)","directories":{},"_nodeVersion":"23.4.0","dependencies":{"tslib":"^2.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bau-log-hero_1.3.0_1734082254962_0.9409142735853504","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@baudevs/bau-log-hero","version":"1.5.0","keywords":["logging","browser","node","colors","timestamp","baudevs","baudevs-monorepo"],"author":{"name":"Baudevs"},"license":"CC BY-NC 4.0","_id":"@baudevs/bau-log-hero@1.5.0","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"dist":{"shasum":"d9e66359c2b3a43f598f1cde79545cc184b24970","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.5.0.tgz","fileCount":7,"integrity":"sha512-X8o+y00RUS7l988HvWyczH2tAF2JyeFDtoRYIU8F7B3oolYLa5cVd21Q140q6ag3JHx5oTDsIs/fcoL6YDespQ==","signatures":[{"sig":"MEQCIH1yZfsSR+VET7u0VVDr/BMrhTNZrIqZ8+3oclL2gwdmAiBe6NCDB+siEEGogL7/Ez5aiUY1nWDq3DFETHu5kjfIXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22992},"main":"./index.cjs.js","type":"module","types":"./index.d.ts","unpkg":"./index.js","module":"./index.esm.js","engines":{"node":">=18"},"exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./esm/index.js","require":"./cjs/index.js"}},"gitHead":"a7b2ecfe8656510b58d1034aa7729b6a03a6b915","private":false,"scripts":{"pwd":"exec -- pwd","build":"rollup -c rollup.config.mjs","clean":"rimraf ../../dist/libs/@baudevs/bau-log-hero"},"_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"jsdelivr":"./index.js.gz","repository":{"url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero","type":"git"},"_npmVersion":"11.0.0","description":"A simple, no dependencies logging library for browser and node, with colors, timestamp, and easy to activate/deactivate by file and compatible with tree-shakeable","directories":{},"projectType":"library","sideEffects":false,"_nodeVersion":"23.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.10","typescript":"^5.7.2","@babel/core":"^7.26.0","@types/node":"^20.17.12","@babel/preset-env":"^7.26.0","@babel/preset-react":"^7.26.3","@rollup/plugin-json":"^5.0.2","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^23.0.7","@babel/preset-typescript":"^7.26.0","@rollup/plugin-typescript":"^10.0.1","rollup-plugin-typescript2":"^0.31.2","@rollup/plugin-node-resolve":"^15.3.1"},"_npmOperationalInternal":{"tmp":"tmp/bau-log-hero_1.5.0_1736375464301_0.6026589930052","host":"s3://npm-registry-packages-npm-production"}},"1.6.0":{"name":"@baudevs/bau-log-hero","version":"1.6.0","keywords":["logging","browser","node","colors","timestamp","baudevs","baudevs-monorepo"],"author":{"name":"Baudevs"},"license":"CC BY-NC 4.0","_id":"@baudevs/bau-log-hero@1.6.0","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"dist":{"shasum":"06fd8e8050f9be94844de0ad85956a8f0b992f78","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.6.0.tgz","fileCount":7,"integrity":"sha512-6S7z8a0YBbnsmLhuz+MAvAoUWL5K9L1F+Rr8I4TwRtmOXw2Sm+wPFJplCYuZCqnPzUk69UxM1vjQZnIH7Xgqvg==","signatures":[{"sig":"MEQCIC1/OQEib2VseGSs7DuXLfFZpGX7omFh4hxFim+UlcF4AiAdlynPuyrx8Wxt0L2IKG9qXjHHReGpu9KI1vdYPpcyGA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23464},"main":"./index.cjs.js","type":"module","types":"./index.d.ts","unpkg":"./index.js","module":"./index.esm.js","engines":{"node":">=18"},"exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./esm/index.js","require":"./cjs/index.js"}},"gitHead":"0009e016fcc7fcca470ed52345e930a819eb518c","private":false,"scripts":{"pwd":"exec -- pwd","build":"rollup -c rollup.config.mjs","clean":"rimraf ../../dist/libs/@baudevs/bau-log-hero"},"_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"jsdelivr":"./index.js.gz","repository":{"url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero","type":"git"},"_npmVersion":"11.0.0","description":"A simple, no dependencies logging library for browser and node, with colors, timestamp, and easy to activate/deactivate by file and compatible with tree-shakeable","directories":{},"projectType":"library","sideEffects":false,"_nodeVersion":"23.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.10","typescript":"^5.7.2","@babel/core":"^7.26.0","@types/node":"^20.17.12","@babel/preset-env":"^7.26.0","@babel/preset-react":"^7.26.3","@rollup/plugin-json":"^5.0.2","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^23.0.7","@babel/preset-typescript":"^7.26.0","@rollup/plugin-typescript":"^10.0.1","rollup-plugin-typescript2":"^0.31.2","@rollup/plugin-node-resolve":"^15.3.1"},"_npmOperationalInternal":{"tmp":"tmp/bau-log-hero_1.6.0_1736377332986_0.7559304871504509","host":"s3://npm-registry-packages-npm-production"}},"1.7.0":{"name":"@baudevs/bau-log-hero","version":"1.7.0","keywords":["logging","browser","node","colors","timestamp","baudevs","baudevs-monorepo"],"author":{"name":"Baudevs"},"license":"CC BY-NC 4.0","_id":"@baudevs/bau-log-hero@1.7.0","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"dist":{"shasum":"2edb8c1e4f53631efb0a233b0d1200f23c2c8a40","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.7.0.tgz","fileCount":7,"integrity":"sha512-Cj8cWqAtWz7H6J9KeHVIh8iQLO9va9OFvU39m6mNg9CzgT/r1nm4+0N1mhdph+tLrKWFCzoN6xxuNa03QFUYWA==","signatures":[{"sig":"MEYCIQDsG5mmaueEI4P5Tv0Id4XTwCFTaTSDjhXrac2fHwxVVAIhAKicwYKZU+Fv/eJBe1G+UlyxbtRVGvuJZWcbczUE45AS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23585},"main":"./index.cjs.js","type":"module","types":"./index.d.ts","unpkg":"./index.js","module":"./index.esm.js","engines":{"node":">=18"},"exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./esm/index.js","require":"./cjs/index.js"}},"gitHead":"e3cb72ed0ae7c9bdcf8e5f671255c245a071e9b4","private":false,"scripts":{"pwd":"exec -- pwd","build":"rollup -c rollup.config.mjs","clean":"rimraf ../../dist/libs/@baudevs/bau-log-hero"},"_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"jsdelivr":"./index.js.gz","repository":{"url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero","type":"git"},"_npmVersion":"11.0.0","description":"A simple, no dependencies logging library for browser and node, with colors, timestamp, and easy to activate/deactivate by file and compatible with tree-shakeable","directories":{},"projectType":"library","sideEffects":false,"_nodeVersion":"23.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.10","typescript":"^5.7.2","@babel/core":"^7.26.0","@types/node":"^20.17.12","@babel/preset-env":"^7.26.0","@babel/preset-react":"^7.26.3","@rollup/plugin-json":"^5.0.2","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^23.0.7","@babel/preset-typescript":"^7.26.0","@rollup/plugin-typescript":"^10.0.1","rollup-plugin-typescript2":"^0.31.2","@rollup/plugin-node-resolve":"^15.3.1"},"_npmOperationalInternal":{"tmp":"tmp/bau-log-hero_1.7.0_1736377487368_0.20969231785705045","host":"s3://npm-registry-packages-npm-production"}},"1.9.0":{"name":"@baudevs/bau-log-hero","version":"1.9.0","description":"A simple, no dependencies logging library for browser and node, with colors, timestamp, and easy to activate/deactivate by file and compatible with tree-shakeable","keywords":["logging","browser","node","colors","timestamp","baudevs","baudevs-monorepo"],"author":{"name":"Baudevs"},"license":"CC BY-NC 4.0","private":false,"projectType":"library","repository":{"type":"git","url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero"},"publishConfig":{"access":"public"},"type":"module","main":"./index.cjs.js","module":"./index.esm.js","types":"./index.d.ts","unpkg":"./index.js","jsdelivr":"./index.js.gz","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","require":"./cjs/index.js","default":"./esm/index.js"}},"dependencies":{},"devDependencies":{"@babel/core":"^7.26.0","@babel/preset-env":"^7.26.0","@babel/preset-react":"^7.26.3","@babel/preset-typescript":"^7.26.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^23.0.7","@rollup/plugin-json":"^5.0.2","@rollup/plugin-node-resolve":"^15.3.1","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^10.0.1","@types/node":"^20.17.12","rimraf":"^5.0.10","rollup-plugin-typescript2":"^0.31.2","typescript":"^5.7.2"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"build":"rollup -c rollup.config.mjs","clean":"rimraf ../../dist/libs/@baudevs/bau-log-hero","pwd":"exec -- pwd"},"_id":"@baudevs/bau-log-hero@1.9.0","_integrity":"sha512-a4ScHFMQjX9g1JdumH0dO2huYWNpbkAg3QI09sOQvcYxxhBe/C81oFafn4o4YDPB8omo63kT694gcVhY3F64rQ==","_resolved":"/private/var/folders/8t/3llhkj655c3500j53s1b4x2w0000gn/T/9c714cd7e05cc0f8dbd4d8136a9943c1/baudevs-bau-log-hero-1.9.0.tgz","_from":"file:baudevs-bau-log-hero-1.9.0.tgz","_nodeVersion":"23.3.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-a4ScHFMQjX9g1JdumH0dO2huYWNpbkAg3QI09sOQvcYxxhBe/C81oFafn4o4YDPB8omo63kT694gcVhY3F64rQ==","shasum":"78da4bd0ff75af1a4465f2476b687acf1c9f9bf8","tarball":"https://registry.npmjs.org/@baudevs/bau-log-hero/-/bau-log-hero-1.9.0.tgz","fileCount":7,"unpackedSize":24924,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAc0VSj7yaGdxhsPAc8zw1tZbszwgG12fSctp23HccBQIhAJLAa3s3mPCdWHFuuylE3lJTI0wP8ssWTGP+2hEXb4Fy"}]},"_npmUser":{"name":"baudevs_tech","email":"tech@baudevs.com"},"directories":{},"maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bau-log-hero_1.9.0_1736413359821_0.16051042175510744"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-12T20:02:19.468Z","modified":"2025-01-09T09:02:40.134Z","1.2.0":"2024-12-12T20:02:19.758Z","1.2.1":"2024-12-13T09:09:17.328Z","1.2.2":"2024-12-13T09:20:11.761Z","1.3.0":"2024-12-13T09:30:55.189Z","1.5.0":"2025-01-08T22:31:04.544Z","1.6.0":"2025-01-08T23:02:13.301Z","1.7.0":"2025-01-08T23:04:47.614Z","1.9.0":"2025-01-09T09:02:39.958Z"},"author":{"name":"Baudevs"},"license":"CC BY-NC 4.0","keywords":["logging","browser","node","colors","timestamp","baudevs","baudevs-monorepo"],"repository":{"type":"git","url":"https://github.com/baudevs/baudevs-monorepo.git/bauLogHero"},"description":"A simple, no dependencies logging library for browser and node, with colors, timestamp, and easy to activate/deactivate by file and compatible with tree-shakeable","maintainers":[{"name":"baudevs_tech","email":"tech@baudevs.com"}],"readme":"# BauLogHero\n\nA powerful, modern logging library for both Node.js and browser environments, with support for structured logging, file rotation, and smart console output.\n\n## Features\n\n- 🌐 **Universal Support**: Works in both Node.js and browser environments\n- 📝 **JSON Lines Format**: Structured logging for better analytics\n- 🔄 **File Rotation**: Size-based rotation with compression\n- 🎨 **Smart Console Output**: Truncated JSON for better readability\n- 💾 **Browser Storage**: Multiple storage options (download, localStorage, console)\n- 🎯 **Type Safety**: Written in TypeScript with full type definitions\n- 🚀 **Modern APIs**: Uses latest Node.js and browser APIs\n\n## Installation\n\n```bash\nnpm install @baudevs/bau-log-hero\n# or\npnpm add @baudevs/bau-log-hero\n# or\nyarn add @baudevs/bau-log-hero\n```\n\n## Quick Start\n\n```typescript\nimport { createLogger } from '@baudevs/bau-log-hero';\n\nconst logger = createLogger({\n  name: 'my-app',\n  level: 'debug',\n  output: {\n    console: {\n      enabled: true,\n      truncateJson: {\n        enabled: true,\n        firstLines: 4,\n        lastLines: 4\n      }\n    },\n    file: {\n      enabled: true,\n      path: './logs',\n      format: 'json',\n      rotation: {\n        enabled: true,\n        maxSize: 5 * 1024 * 1024, // 5MB\n        maxFiles: 5,\n        compress: true\n      }\n    }\n  }\n});\n\n// Basic logging\nlogger.info('Application started');\n\n// Structured logging\nlogger.info('User action', {\n  userId: '123',\n  action: 'login',\n  metadata: {\n    ip: '127.0.0.1',\n    userAgent: 'Chrome'\n  }\n});\n```\n\n## Configuration\n\n### Console Output\n\n```typescript\n{\n  console: {\n    enabled: true,\n    truncateJson: {\n      enabled: true,     // Enable JSON truncation in console\n      firstLines: 4,     // Show first 4 lines\n      lastLines: 4       // Show last 4 lines\n    }\n  }\n}\n```\n\n### File Output\n\n```typescript\n{\n  file: {\n    enabled: true,\n    path: './logs',\n    format: 'json',      // 'json' or 'text'\n    rotation: {\n      enabled: true,\n      maxSize: 5 * 1024 * 1024,  // 5MB\n      maxFiles: 5,\n      compress: true     // Compress rotated files\n    }\n  }\n}\n```\n\n### Browser Fallbacks\n\nWhen running in a browser, file output falls back to one of these options:\n\n```typescript\n{\n  file: {\n    browserFallback: 'download'    // Save as .jsonl file\n    // or\n    browserFallback: 'localStorage' // Store in localStorage\n    // or\n    browserFallback: 'console'     // Output to console\n    // or\n    browserFallback: 'none'        // Disable file output\n  }\n}\n```\n\n## Log Format\n\n### JSON Lines Format\n\nEach log entry is written as a complete JSON object on a single line. Lines are separated by newlines, not commas. To read these files:\n\n```typescript\n// Node.js example\nimport { createReadStream } from 'node:fs';\nimport { createInterface } from 'node:readline';\n\nconst readLogs = async (filePath: string) => {\n  const fileStream = createReadStream(filePath);\n  const rl = createInterface({\n    input: fileStream,\n    crlfDelay: Infinity\n  });\n\n  for await (const line of rl) {\n    const logEntry = JSON.parse(line);\n    // Process log entry\n  }\n};\n```\n\n❌ Don't try to parse the entire file as JSON:\n\n```typescript\n// This will fail\nconst logs = JSON.parse(fs.readFileSync('logs.jsonl', 'utf8'));\n```\n\n✅ Process one line at a time:\n\n```typescript\n// This is correct\nconst lines = fs.readFileSync('logs.jsonl', 'utf8').split('\\n');\nfor (const line of lines) {\n  if (line.trim()) {\n    const logEntry = JSON.parse(line);\n    // Process log entry\n  }\n}\n```\n\n### Console Output\n\nConsole output includes:\n\n- Emoji indicators (🔍 debug, ℹ️ info, ⚠️ warn, ❌ error)\n- Timestamps in dim color\n- Log level in appropriate color\n- Source filename\n- Truncated JSON for better readability\n\nExample:\n\n```json\nℹ️ [2024-01-07T12:34:56.789Z] INFO [app.ts] → User logged in\n{\n  userId: \"123\",\n  action: \"login\",\n  ...\n  metadata: {\n    ip: \"127.0.0.1\"\n  }\n}\n```\n\n## Browser Storage\n\n### LocalStorage\n\n- Uses size-based rotation like Node.js\n- Default 5MB limit\n- Stores in JSON Lines format\n- Automatically removes oldest entries when full\n\n### Download\n\n- Saves immediately as `.jsonl` file\n- Uses File System Access API when available\n- Falls back to legacy download for older browsers\n- Includes timestamp in filename\n\n## Best Practices\n\n1. Use structured logging:\n\n```typescript\n// Good\nlogger.info('User action', { userId, action, data });\n\n// Avoid\nlogger.info(`User ${userId} performed ${action}`);\n```\n\n2. Use appropriate log levels:\n\n```typescript\nlogger.debug('Detailed debugging info');\nlogger.info('Normal operation events');\nlogger.warn('Warning conditions');\nlogger.error('Error conditions');\n```\n\n3. Include context in logs:\n\n```typescript\nlogger.info('API request', {\n  method: 'GET',\n  path: '/api/users',\n  duration: 123,\n  status: 200\n});\n```\n\n4. Configure rotation limits based on your needs:\n\n```typescript\n{\n  rotation: {\n    maxSize: 10 * 1024 * 1024,  // 10MB per file\n    maxFiles: 7,                 // Keep 1 week of logs\n    compress: true              // Save disk space\n  }\n}\n```\n\n## Smart Analysis\n\nBauLogHero includes a powerful smart analysis feature that helps you make sense of your logs by automatically grouping and analyzing patterns in real-time.\n\n### Features\n\n- 🔍 **Pattern Detection**: Automatically groups similar log messages using efficient string similarity algorithms\n- 🎯 **Context Extraction**: Extracts and tracks IPs, URLs, status codes, and other contextual information\n- ⚡️ **Real-time Analysis**: Analyzes logs as they come in, with configurable thresholds\n- 📊 **Intelligent Summaries**: Generates insights about log patterns and their frequencies\n\n### Usage\n\n```typescript\nimport { createLogger, SmartAnalyzer } from '@baudevs/bau-log-hero';\n\n// Create analyzer with custom options\nconst analyzer = new SmartAnalyzer({\n  groupingSimilarityThreshold: 0.8,  // How similar messages should be to group (0-1)\n  timeWindowMinutes: 60,             // Time window for analysis\n  maxGroups: 100,                    // Maximum number of pattern groups to track\n  minGroupSize: 3                    // Minimum entries to form a group\n});\n\n// Create logger and connect to analyzer\nconst logger = createLogger({\n  name: 'my-app',\n  level: 'debug'\n});\n\n// Analyze logs as they come in\nlogger.on('log', (entry) => analyzer.analyze(entry));\n\n// Get insights periodically\nsetInterval(() => {\n  const { groups, summary } = analyzer.getInsights();\n  console.log('Log Analysis Summary:', summary);\n  \n  // Example output:\n  // Analyzed 1250 events in 45 groups.\n  // Found 3 high-severity patterns.\n  // Top patterns:\n  // - \"Failed to connect to database\" (23 times)\n  // - \"Request timeout for /api/users\" (15 times)\n  // - \"Invalid authentication token\" (12 times)\n  \n  // Access detailed group information\n  groups.forEach(group => {\n    console.log(`Pattern: ${group.pattern}`);\n    console.log(`Frequency: ${group.frequency}`);\n    console.log(`Severity: ${group.severity}`);\n    console.log(`First seen: ${group.firstSeen}`);\n    console.log(`Last seen: ${group.lastSeen}`);\n    console.log(`Context:`, group.context);\n  });\n}, 60000);\n```\n\n### Configuration Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| groupingSimilarityThreshold | number | 0.8 | How similar messages should be to be grouped (0-1) |\n| timeWindowMinutes | number | 60 | Time window for analysis in minutes |\n| maxGroups | number | 100 | Maximum number of pattern groups to track |\n| minGroupSize | number | 3 | Minimum entries required to form a group |\n\n### Pattern Detection\n\nThe analyzer uses string similarity algorithms to group logs, with features like:\n\n- Variable data normalization (timestamps, UUIDs, numbers)\n- Token-based similarity matching\n- Configurable similarity thresholds\n- Automatic pattern extraction\n\n### Context Tracking\n\nAutomatically extracts and tracks contextual information:\n\n- IP addresses\n- URLs and endpoints\n- HTTP status codes\n- Custom context from log metadata\n- Frequency analysis of values\n\n### Privacy and Performance\n\n- 🔒 All analysis happens locally in your application\n- 💨 Zero external dependencies\n- 🚀 Efficient string matching algorithms\n- 💾 Configurable memory usage limits\n- ⚡️ Real-time processing with minimal overhead\n\n## License\n\nMIT\n\n## Log File Reading\n\nBauLogHero provides several utilities for reading log files efficiently:\n\n### Stream Reading (for large files)\n\n```typescript\nimport { readLogsStream } from '@baudevs/bau-log-hero';\n\n// Process large files efficiently with streams\nfor await (const entry of readLogsStream('./logs/app.jsonl')) {\n  // Process each log entry\n  console.log(entry.timestamp, entry.message);\n}\n```\n\n### Sync Reading (for small files)\n\n```typescript\nimport { readLogsSync } from '@baudevs/bau-log-hero';\n\n// Read all logs at once\nconst entries = await readLogsSync('./logs/app.jsonl');\nentries.forEach(entry => {\n  console.log(entry.timestamp, entry.message);\n});\n```\n\n### Reading Last N Entries\n\n```typescript\nimport { readLastLogs } from '@baudevs/bau-log-hero';\n\n// Get the last 100 log entries\nconst recentLogs = await readLastLogs('./logs/app.jsonl', 100);\n```\n\n### Reading by Time Range\n\n```typescript\nimport { readLogsInRange } from '@baudevs/bau-log-hero';\n\nconst startTime = new Date('2024-01-01T00:00:00Z');\nconst endTime = new Date('2024-01-02T00:00:00Z');\n\n// Get logs within a specific time range\nconst logs = await readLogsInRange('./logs/app.jsonl', startTime, endTime);\n```\n\n## Validation Utilities\n\nBauLogHero includes validation utilities to ensure proper logging practices:\n\n### Log Level Validation\n\n```typescript\nimport { isValidLogLevel } from '@baudevs/bau-log-hero';\n\nif (isValidLogLevel(level)) {\n  logger.log(level, message);\n}\n```\n\n### Structured Logging Validation\n\n```typescript\nimport { validateStructuredLog } from '@baudevs/bau-log-hero';\n\nconst { isValid, error } = validateStructuredLog(message, data);\nif (!isValid) {\n  console.warn(`Invalid log format: ${error}`);\n  return;\n}\n\n// Good: Structured logging\nlogger.info('User action', { userId, action, data });\n\n// Bad: Will fail validation\nlogger.info(`User ${userId} performed ${action}`); // Template literals not allowed\n```\n\n### Context Validation\n\n```typescript\nimport { validateLogContext } from '@baudevs/bau-log-hero';\n\nconst context = {\n  ip: '127.0.0.1',\n  method: 'GET',\n  path: '/api/users',\n  status: 200\n};\n\nconst { isValid, error } = validateLogContext(context);\nif (!isValid) {\n  console.warn(`Invalid context: ${error}`);\n  return;\n}\n\nlogger.info('API request', context);\n```\n\n### Log Entry Validation\n\n```typescript\nimport { validateLogEntry } from '@baudevs/bau-log-hero';\n\n// Validate log entries when reading from file\nfor await (const line of readLines('./logs/app.jsonl')) {\n  try {\n    const entry = JSON.parse(line);\n    if (validateLogEntry(entry)) {\n      // Process valid log entry\n    }\n  } catch (error) {\n    console.warn('Invalid log entry:', error);\n  }\n}\n```\n","readmeFilename":"README.md"}