{"_id":"@2run/logger","_rev":"4-85dc682ac70dfa3a32e4a41dd808c2e1","name":"@2run/logger","dist-tags":{"latest":"1.2.2"},"versions":{"1.0.0":{"name":"@2run/logger","version":"1.0.0","keywords":["logger","logging","typescript","react-native","node","structured-logging","json-logger","file-logging","mobile"],"author":{"name":"2Run","email":"halil@2run.be"},"license":"MIT","_id":"@2run/logger@1.0.0","maintainers":[{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"}],"homepage":"https://github.com/2run/logger#readme","bugs":{"url":"https://github.com/2run/logger/issues"},"dist":{"shasum":"f80c42c4be3cd6f20e797cb024cf7ad348a41a02","tarball":"https://registry.npmjs.org/@2run/logger/-/logger-1.0.0.tgz","fileCount":24,"integrity":"sha512-Adir6QJiv1zmPYY98QlwnFpulqpVUb7RRQ98c+k92vcoTD3UZRKKwcGUWyngN3HsLaNrH91qfWlg4nvnIGiLMg==","signatures":[{"sig":"MEYCIQCxH7E+LgfkBfg01XkvzMqq5vPLLPkBgop7Z6c4VzVDrgIhAJ9ZQq0V/m5jqrsVpW/NPEcLo9sN0eXWNbj0dsUi4ORu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":119795},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./formatters":{"types":"./dist/formatters/index.d.ts","import":"./dist/formatters/index.mjs","require":"./dist/formatters/index.js"},"./transports":{"types":"./dist/transports/index.d.ts","import":"./dist/transports/index.mjs","require":"./dist/transports/index.js"}},"gitHead":"c96a114c60314f1cea734206858ce532e41935eb","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsup","format":"prettier --write \"src/**/*.ts\"","lint:fix":"eslint src --ext .ts --fix","typecheck":"tsc --noEmit","test:watch":"jest --watch","format:check":"prettier --check \"src/**/*.ts\"","test:coverage":"jest --coverage","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"},"repository":{"url":"git+https://github.com/2run/logger.git","type":"git"},"_npmVersion":"11.5.2","description":"Lightweight, type-safe logger with history, transports, and JSON support for Node.js and React Native","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tsup":"^8.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react-native":">=0.60.0"},"peerDependenciesMeta":{"react-native":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/logger_1.0.0_1765588533488_0.7397202865011399","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@2run/logger","version":"1.0.1","keywords":["logger","logging","typescript","react-native","node","structured-logging","json-logger","file-logging","mobile"],"author":{"name":"2Run","email":"halil@2run.be"},"license":"MIT","_id":"@2run/logger@1.0.1","maintainers":[{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"}],"homepage":"https://github.com/halilertekin/logger#readme","bugs":{"url":"https://github.com/halilertekin/logger/issues"},"dist":{"shasum":"952308f2bb548b523d6b4c6890e05cb5d0192937","tarball":"https://registry.npmjs.org/@2run/logger/-/logger-1.0.1.tgz","fileCount":24,"integrity":"sha512-nEQkfpTRiJtzG4WbEGILOBcUoy06neQb/H52YJ2QeBoItmBKa7qnMfR+hSCgdFKemyJcKnsh6mPyk00VgTjm1w==","signatures":[{"sig":"MEUCIQDp+8dQPFm/juMPcw28iWakgg5v4s3mQjVBnJ8iqk/0BwIgAkOZWWWP+XtQvNrrUvFqnbiEuoZp1K5/Gw6VjAwyiMY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120093},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./formatters":{"types":"./dist/formatters/index.d.ts","import":"./dist/formatters/index.mjs","require":"./dist/formatters/index.js"},"./transports":{"types":"./dist/transports/index.d.ts","import":"./dist/transports/index.mjs","require":"./dist/transports/index.js"}},"gitHead":"b8188a15989f4d00e0a6b51c114081abb7a10d88","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsup","format":"prettier --write \"src/**/*.ts\"","lint:fix":"eslint src --ext .ts --fix","typecheck":"tsc --noEmit","test:watch":"jest --watch","format:check":"prettier --check \"src/**/*.ts\"","test:coverage":"jest --coverage","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"},"repository":{"url":"git+https://github.com/halilertekin/logger.git","type":"git"},"_npmVersion":"11.5.2","description":"Lightweight, type-safe logger with history, transports, and JSON support for Node.js and React Native","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tsup":"^8.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react-native":">=0.60.0"},"peerDependenciesMeta":{"react-native":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/logger_1.0.1_1765827224040_0.4343393837189986","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@2run/logger","version":"1.2.1","keywords":["logger","logging","typescript","react-native","node","structured-logging","json-logger","file-logging","mobile"],"author":{"name":"2Run","email":"halil@2run.be"},"license":"MIT","_id":"@2run/logger@1.2.1","maintainers":[{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"}],"homepage":"https://github.com/halilertekin/logger#readme","bugs":{"url":"https://github.com/halilertekin/logger/issues"},"dist":{"shasum":"4fc6b85ec84187525cd60415090a619dbdf81f30","tarball":"https://registry.npmjs.org/@2run/logger/-/logger-1.2.1.tgz","fileCount":27,"integrity":"sha512-xnRHrys9/jQLN4bTfgNVE1xm1q3SmXgUEcTKZJibftcZKMsgivsK83JABE85lrREVZ+dNMhaZEPYxoMntbMSlQ==","signatures":[{"sig":"MEYCIQD2csPmVbSflaeU8E9clf6FEvSCH/jxqRoGRl9TY4LMOwIhALUOvH4pxpPtkvBTNtHER8ESu4ABniJY7YCg5gVR2sZJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@2run%2flogger@1.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":162847},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","browser":{"fs":"./shims/fs.js","path":"./shims/path.js","https":"./shims/https.js","node:fs":"./shims/fs.js","node:path":"./shims/path.js","node:https":"./shims/https.js"},"engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./formatters":{"types":"./dist/formatters/index.d.ts","import":"./dist/formatters/index.mjs","require":"./dist/formatters/index.js"},"./transports":{"types":"./dist/transports/index.d.ts","import":"./dist/transports/index.mjs","require":"./dist/transports/index.js"}},"gitHead":"9e708bbaf423419baadb483e99d5dce22981214c","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsup","format":"prettier --write \"src/**/*.ts\"","lint:fix":"eslint src --ext .ts --fix","typecheck":"tsc --noEmit","test:watch":"jest --watch","format:check":"prettier --check \"src/**/*.ts\"","test:coverage":"jest --coverage","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"},"repository":{"url":"git+https://github.com/halilertekin/logger.git","type":"git"},"_npmVersion":"10.8.2","description":"Lightweight, type-safe logger with history, transports, and JSON support for Node.js and React Native","directories":{},"_nodeVersion":"20.20.2","react-native":{"fs":"./shims/fs.js","path":"./shims/path.js","https":"./shims/https.js","node:fs":"./shims/fs.js","node:path":"./shims/path.js","node:https":"./shims/https.js"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tsup":"^8.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react-native":">=0.60.0"},"peerDependenciesMeta":{"react-native":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/logger_1.2.1_1778408218700_0.8197495136315665","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@2run/logger","version":"1.2.2","description":"Lightweight, type-safe logger with history, transports, and JSON support for Node.js and React Native","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"react-native":{"types":"./dist/index.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"},"browser":{"types":"./dist/index.d.ts","import":"./dist/index.browser.mjs","require":"./dist/index.browser.js"},"node":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"default":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"./formatters":{"react-native":{"types":"./dist/formatters/index.d.ts","import":"./dist/formatters/index.browser.mjs","require":"./dist/formatters/index.browser.js"},"browser":{"types":"./dist/formatters/index.d.ts","import":"./dist/formatters/index.browser.mjs","require":"./dist/formatters/index.browser.js"},"node":{"types":"./dist/formatters/index.d.ts","import":"./dist/formatters/index.mjs","require":"./dist/formatters/index.js"},"default":{"types":"./dist/formatters/index.d.ts","import":"./dist/formatters/index.mjs","require":"./dist/formatters/index.js"}},"./transports":{"react-native":{"types":"./dist/transports/index.d.ts","import":"./dist/transports/index.browser.mjs","require":"./dist/transports/index.browser.js"},"browser":{"types":"./dist/transports/index.d.ts","import":"./dist/transports/index.browser.mjs","require":"./dist/transports/index.browser.js"},"node":{"types":"./dist/transports/index.d.ts","import":"./dist/transports/index.mjs","require":"./dist/transports/index.js"},"default":{"types":"./dist/transports/index.d.ts","import":"./dist/transports/index.mjs","require":"./dist/transports/index.js"}}},"react-native":{"fs":"./shims/fs.js","path":"./shims/path.js","https":"./shims/https.js","node:fs":"./shims/fs.js","node:path":"./shims/path.js","node:https":"./shims/https.js"},"browser":{"fs":"./shims/fs.js","path":"./shims/path.js","https":"./shims/https.js","node:fs":"./shims/fs.js","node:path":"./shims/path.js","node:https":"./shims/https.js"},"scripts":{"build":"tsup","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"eslint src --ext .ts","lint:fix":"eslint src --ext .ts --fix","format":"prettier --write \"src/**/*.ts\"","format:check":"prettier --check \"src/**/*.ts\"","typecheck":"tsc --noEmit","prepublishOnly":"npm run test && npm run build"},"keywords":["logger","logging","typescript","react-native","node","structured-logging","json-logger","file-logging","mobile"],"author":{"name":"2Run","email":"halil@2run.be"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/halilertekin/logger.git"},"bugs":{"url":"https://github.com/halilertekin/logger/issues"},"homepage":"https://github.com/halilertekin/logger#readme","peerDependencies":{"react-native":">=0.60.0"},"peerDependenciesMeta":{"react-native":{"optional":true}},"devDependencies":{"@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","jest":"^29.0.0","prettier":"^3.0.0","ts-jest":"^29.0.0","tsup":"^8.0.0","typescript":"^5.0.0"},"engines":{"node":">=14.0.0"},"gitHead":"9ec7e4f66e08b266e34c5664ebc45c88cebf154e","_id":"@2run/logger@1.2.2","_nodeVersion":"26.0.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-B/eDEmdkFd+9jYkIya95oIOsD4H3TlhrAG58/P1pjbdgPJ5m4ZRTyCvT9zbqvzBSV9vRNcrF9gkz1Wknv+HBrA==","shasum":"4b17aacda1cf5b8de4e58b1c2ca1d41ea84c8786","tarball":"https://registry.npmjs.org/@2run/logger/-/logger-1.2.2.tgz","fileCount":39,"unpackedSize":304073,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGo9lj0l10b/OQokwMENIVgjUB05E88NOWPupLciuDtqAiB9I9U+S4uWDrVYToyWL8ZMYYNUFWdODU5FI22/mtQS2A=="}]},"_npmUser":{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"},"directories":{},"maintainers":[{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/logger_1.2.2_1779490945393_0.22182620341787262"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-13T01:15:33.346Z","modified":"2026-05-22T23:02:25.684Z","1.0.0":"2025-12-13T01:15:33.643Z","1.0.1":"2025-12-15T19:33:44.172Z","1.2.1":"2026-05-10T10:16:58.855Z","1.2.2":"2026-05-22T23:02:25.538Z"},"bugs":{"url":"https://github.com/halilertekin/logger/issues"},"author":{"name":"2Run","email":"halil@2run.be"},"license":"MIT","homepage":"https://github.com/halilertekin/logger#readme","keywords":["logger","logging","typescript","react-native","node","structured-logging","json-logger","file-logging","mobile"],"repository":{"type":"git","url":"git+https://github.com/halilertekin/logger.git"},"description":"Lightweight, type-safe logger with history, transports, and JSON support for Node.js and React Native","maintainers":[{"name":"halilertekin","email":"maxcoder@hotmail.co.uk"}],"readme":"# @2run/logger\n\n[![npm version](https://img.shields.io/npm/v/@2run/logger.svg)](https://www.npmjs.com/package/@2run/logger)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)\n\nLightweight, type-safe logger with history, transports, and JSON support for Node.js and React Native.\n\n## Features\n\n- ✅ **TypeScript First**: Full type safety with strict mode\n- ✅ **Zero Dependencies**: No external runtime dependencies\n- ✅ **Platform Agnostic**: Works in Node.js, React Native, and browsers\n- ✅ **Pluggable Transports**: Console, file, or custom transports\n- ✅ **Multiple Formatters**: Text or JSON output\n- ✅ **Log History**: Configurable in-memory history\n- ✅ **Subscriptions**: Listen to log events in real-time\n- ✅ **Log Filtering**: Environment-based log level filtering\n- ✅ **File Rotation**: Automatic file rotation for Node.js\n- ✅ **Safe Serialization**: Handles circular references and Error objects\n- ✅ **Async Support**: Non-blocking file writes with buffering\n\n## Installation\n\n```bash\nnpm install @2run/logger\n# or\nyarn add @2run/logger\n# or\npnpm add @2run/logger\n```\n\n## Quick Start\n\n### Basic Usage\n\n```typescript\nimport { logger } from '@2run/logger';\n\n// Simple logging\nlogger.info('Application started');\nlogger.debug('Debug information', { userId: 123 });\nlogger.warn('Warning message');\nlogger.error('Error occurred', { error: new Error('Something went wrong') });\n```\n\n### Custom Logger with Configuration\n\n```typescript\nimport { createLogger, JSONFormatter, FileTransport } from '@2run/logger';\n\nconst logger = createLogger({\n  prefix: 'MyApp',\n  minLogLevel: 'info',\n  maxHistory: 500,\n  defaultMetadata: { appVersion: '1.0.0' },\n});\n\nlogger.info('Configured logger ready');\n```\n\n### JSON Logging (Structured Logs)\n\n```typescript\nimport { createLogger, JSONFormatter, ConsoleTransport } from '@2run/logger';\n\nconst logger = createLogger({\n  transports: [new ConsoleTransport(new JSONFormatter())],\n});\n\nlogger.info('User action', { userId: 123, action: 'login' });\n// Output: {\"timestamp\":\"2025-12-13T10:30:00.000Z\",\"level\":\"info\",\"message\":\"User action\",\"id\":\"...\",\"metadata\":{\"userId\":123,\"action\":\"login\"}}\n```\n\n### File Logging (Node.js)\n\n```typescript\nimport { createLogger, FileTransport } from '@2run/logger';\n\nconst logger = createLogger({\n  transports: [\n    new FileTransport({\n      filePath: './logs/app.log',\n      maxFileSize: 10 * 1024 * 1024, // 10MB\n      maxFiles: 5,\n    }),\n  ],\n});\n\nlogger.info('This will be written to file');\n```\n\n### Multiple Transports\n\n```typescript\nimport { createLogger, ConsoleTransport, FileTransport, JSONFormatter } from '@2run/logger';\n\nconst logger = createLogger({\n  transports: [\n    new ConsoleTransport(), // Console output\n    new FileTransport({ filePath: './logs/app.log' }), // File output\n    new FileTransport(\n      { filePath: './logs/app.json.log' },\n      new JSONFormatter() // JSON file output\n    ),\n  ],\n});\n\nlogger.info('Logged to console and two files');\n```\n\n### Log Subscriptions\n\n```typescript\nimport { logger } from '@2run/logger';\n\n// Subscribe to all log events\nconst unsubscribe = logger.subscribe((entry) => {\n  console.log('Log event:', entry);\n  // Send to analytics, remote logging service, etc.\n});\n\nlogger.info('This will trigger the subscription');\n\n// Unsubscribe when done\nunsubscribe();\n```\n\n### React Native Integration\n\n```typescript\nimport { createLogger } from '@2run/logger';\n\n// Logger automatically detects React Native platform\nconst logger = createLogger({\n  prefix: 'MyApp',\n  platformInfo: true, // Includes iOS/Android version info\n});\n\nlogger.info('Running on React Native');\n// Output: [MyApp][INFO] Running on React Native [ios/14.5]\n```\n\n## API Reference\n\n### `createLogger(config?): Logger`\n\nCreates a new logger instance with the given configuration.\n\n**Parameters:**\n\n- `config` (optional): `LoggerConfig`\n  - `prefix` (string): Prefix for log messages (default: '')\n  - `maxHistory` (number): Maximum history size (default: 200)\n  - `minLogLevel` (LogLevel): Minimum log level to emit (default: 'debug' in dev, 'warn' in production)\n  - `platformInfo` (boolean): Include platform info (default: true)\n  - `transports` (Transport[]): Custom transports (default: [ConsoleTransport])\n  - `formatter` (Formatter): Custom formatter (default: TextFormatter)\n  - `defaultMetadata` (Record<string, unknown>): Default metadata for all logs\n  - `correlationIdGenerator` (() => string): Custom ID generator\n\n**Returns:** `Logger` instance\n\n### Logger Methods\n\n#### `logger.debug(message, metadata?)`\n\nLogs a debug message.\n\n#### `logger.info(message, metadata?)`\n\nLogs an info message.\n\n#### `logger.warn(message, metadata?)`\n\nLogs a warning message.\n\n#### `logger.error(message, metadata?)`\n\nLogs an error message.\n\n#### `logger.getHistory(): LogEntry[]`\n\nReturns a copy of the log history.\n\n#### `logger.subscribe(listener): () => void`\n\nSubscribes to log events. Returns an unsubscribe function.\n\n#### `logger.flushToConsole()`\n\nFlushes all history to console with [History] tag.\n\n#### `logger.close(): Promise<void>`\n\nCloses all transports and flushes pending logs.\n\n## TypeScript Types\n\n```typescript\ntype LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\ninterface LogEntry {\n  id: string;\n  level: LogLevel;\n  message: string;\n  metadata?: Record<string, unknown>;\n  timestamp: number;\n}\n\ninterface Transport {\n  log(entry: LogEntry): void | Promise<void>;\n  flush?(): void | Promise<void>;\n  close?(): void | Promise<void>;\n}\n\ninterface Formatter {\n  format(entry: LogEntry, platformInfo?: PlatformInfo): string;\n}\n```\n\n## Examples\n\n### Example: Custom Transport\n\n```typescript\nimport { createLogger } from '@2run/logger';\nimport type { Transport, LogEntry } from '@2run/logger';\n\nclass RemoteTransport implements Transport {\n  async log(entry: LogEntry) {\n    await fetch('https://api.example.com/logs', {\n      method: 'POST',\n      body: JSON.stringify(entry),\n    });\n  }\n}\n\nconst logger = createLogger({\n  transports: [new RemoteTransport()],\n});\n```\n\n### Example: Conditional Logging\n\n```typescript\nimport { createLogger } from '@2run/logger';\n\nconst logger = createLogger({\n  minLogLevel: process.env.NODE_ENV === 'production' ? 'warn' : 'debug',\n});\n\n// This will only log in development\nlogger.debug('Debug info');\n\n// This will log in all environments\nlogger.error('Critical error');\n```\n\n### Example: Correlation IDs\n\n```typescript\nimport { createLogger } from '@2run/logger';\nimport { v4 as uuidv4 } from 'uuid';\n\nconst logger = createLogger({\n  correlationIdGenerator: () => uuidv4(),\n});\n\nlogger.info('Request started'); // ID: abc-123-def\nlogger.info('Processing'); // ID: xyz-456-ghi\n```\n\n## Performance Considerations\n\n- **Async File Writes**: File transport uses buffering and async writes to avoid blocking\n- **Log History**: Limited to configurable size (default: 200 entries)\n- **Lazy Serialization**: Metadata is only serialized when needed\n- **Level Filtering**: Logs below minimum level are filtered before transport\n- **Zero Dependencies**: No runtime overhead from external packages\n\n## Best Practices\n\n1. **Use appropriate log levels**: debug < info < warn < error\n2. **Include contextual metadata**: Add relevant data to help debugging\n3. **Configure per environment**: Use debug in development, warn+ in production\n4. **Handle sensitive data**: Don't log passwords, tokens, or PII\n5. **Use structured logging**: JSON format for production logs\n6. **Implement log rotation**: Prevent disk space issues in long-running apps\n7. **Clean up subscriptions**: Always unsubscribe when components unmount\n\n## Contributing\n\nContributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nMIT © [2Run](https://github.com/halilertekin)\n\n## Support\n\n- 📧 Email: [halil@2run.be](mailto:halil@2run.be)\n- 🐛 Issues: [GitHub Issues](https://github.com/halilertekin/logger/issues)\n- 📖 Documentation: [API Docs](https://github.com/halilertekin/logger#readme)\n\n---\n\nMade with ❤️ by the 2Run team\n","readmeFilename":"README.md"}