{"_id":"@alcyone-labs/simple-logger","_rev":"2-e0229ca5a80d2a5cf200f6b156cbd89f","name":"@alcyone-labs/simple-logger","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@alcyone-labs/simple-logger","version":"1.0.0","keywords":["logger","logging","typescript","portable","zod","json-logger"],"author":{"name":"Alcyone Labs"},"license":"MIT","_id":"@alcyone-labs/simple-logger@1.0.0","maintainers":[{"name":"nembleton","email":"nicolas.embleton@gmail.com"}],"dist":{"shasum":"91a24b98af842076c6d0a8cbf606b80e5b34ced8","tarball":"https://registry.npmjs.org/@alcyone-labs/simple-logger/-/simple-logger-1.0.0.tgz","fileCount":11,"integrity":"sha512-cR8XcvxuajiY4hrhcuICNco4AqRU2IwK1JtgFRAUPTi9pNvWCfIQiOic8C31VBRXKFr9dS8ndTuN3fBQx1pe8g==","signatures":[{"sig":"MEYCIQCMGISKOwmGjd5RfZyz2iNCkDMQSIEGa6qEVhgFE+o6JgIhALlt8kfKvvGhM9tkU/q9wTgyDhwWHP9jEWgLJMqpzhhv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36783},"main":"dist/index.cjs","type":"module","_from":"file:alcyone-labs-simple-logger-1.0.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"lint":"oxlint --ignore-path .gitignore","test":"vitest run","build":"tsc && rolldown -c"},"_npmUser":{"name":"nembleton","email":"nicolas.embleton@gmail.com"},"_resolved":"/private/var/folders/27/xlh5p6rd54vgnqk_t2kq551c0000gn/T/9cc1cfded4823a09e6f97fb16272e038/alcyone-labs-simple-logger-1.0.0.tgz","_integrity":"sha512-cR8XcvxuajiY4hrhcuICNco4AqRU2IwK1JtgFRAUPTi9pNvWCfIQiOic8C31VBRXKFr9dS8ndTuN3fBQx1pe8g==","_npmVersion":"11.7.0","description":"A lightweight, truly portable logging library with Zod validation and multi-transport support.","directories":{},"_nodeVersion":"22.21.0","dependencies":{"zod":"^4.3.5"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","oxlint":"^1.41.0","vitest":"^4.0.17","rolldown":"1.0.0-beta.60","typescript":"^5.9.3","@types/node":"^25.0.9"},"_npmOperationalInternal":{"tmp":"tmp/simple-logger_1.0.0_1768993710684_0.10569944558623234","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@alcyone-labs/simple-logger","version":"1.1.0","description":"A lightweight, truly portable logging library with Zod validation and multi-transport support.","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./iife":{"default":"./dist/index.iife.js"}},"sideEffects":false,"keywords":["logger","logging","typescript","portable","zod","json-logger"],"author":{"name":"Alcyone Labs"},"license":"MIT","type":"module","dependencies":{"zod":"^4.3.5"},"devDependencies":{"@types/node":"^25.0.9","oxlint":"^1.41.0","rolldown":"1.0.0-beta.60","typescript":"^5.9.3","vite":"^7.3.1","vitest":"^4.0.17"},"scripts":{"test":"vitest run","build":"tsc && rolldown -c","lint":"oxlint --ignore-path .gitignore"},"_id":"@alcyone-labs/simple-logger@1.1.0","_integrity":"sha512-8iGCAmooo39OEV/89DHKDZMs1K01ZbEFYS88QrR9DcU7zoRTwmImSRBQdOVecQAcYqSvWGSuJ51sqEuZ+0pcjg==","_resolved":"/private/var/folders/27/xlh5p6rd54vgnqk_t2kq551c0000gn/T/f39c40b6963fc8b88b39c159e733ae73/alcyone-labs-simple-logger-1.1.0.tgz","_from":"file:alcyone-labs-simple-logger-1.1.0.tgz","_nodeVersion":"22.21.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-8iGCAmooo39OEV/89DHKDZMs1K01ZbEFYS88QrR9DcU7zoRTwmImSRBQdOVecQAcYqSvWGSuJ51sqEuZ+0pcjg==","shasum":"153143c2e2f74a93c3604000ce3dad7fe80d17dd","tarball":"https://registry.npmjs.org/@alcyone-labs/simple-logger/-/simple-logger-1.1.0.tgz","fileCount":13,"unpackedSize":1462507,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCRrX/gd3spJcH57DA9zmVOojx/Qj/nA/I6T+MpDbKt8AIhALUiVyWRer2cdwxFe++03UQTtAxkl2EubFpjqWmVqtdd"}]},"_npmUser":{"name":"nembleton","email":"nicolas.embleton@gmail.com"},"directories":{},"maintainers":[{"name":"nembleton","email":"nicolas.embleton@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simple-logger_1.1.0_1770174952957_0.02114583089955313"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-21T11:08:30.284Z","modified":"2026-02-04T03:15:53.349Z","1.0.0":"2026-01-21T11:08:30.817Z","1.1.0":"2026-02-04T03:15:53.206Z"},"author":{"name":"Alcyone Labs"},"license":"MIT","keywords":["logger","logging","typescript","portable","zod","json-logger"],"description":"A lightweight, truly portable logging library with Zod validation and multi-transport support.","maintainers":[{"name":"nembleton","email":"nicolas.embleton@gmail.com"}],"readme":"# @alcyone-labs/simple-logger\n\nA lightweight, flexible, and type-safe logging library for TypeScript applications.\n\n## Features\n\n- **Transports**: Plug-and-play transports (Console, File, Remote, etc.)\n- **Scoped Logging**: Create scoped loggers with persistent contextual metadata.\n- **Type-Safe**: Built with Zod for robust data validation and generic support.\n- **Extensible**: Easy to add custom transports.\n\n## Installation\n\n```bash\npnpm add @alcyone-labs/simple-logger\n```\n\n## Quick Start\n\n```typescript\nimport { useLogging } from \"@alcyone-labs/simple-logger\";\n\nconst logger = useLogging();\n\nlogger.info({\n  message: \"Hello world!\",\n  data: {\n    metadata: { env: \"production\" },\n    foo: \"bar\",\n  },\n});\n```\n\n## Scoped Logging\n\nScoped loggers allow you to attach metadata to every log message generated by that logger instance. This is particularly useful for tracking requests or service-specific logs.\n\n```typescript\nimport { useLogging } from \"@alcyone-labs/simple-logger\";\n\n// Create a logger for a specific service\nconst serviceLogger = useLogging({ service: \"auth-api\" });\n\nfunction handleRequest(userId: string) {\n  // Create a sub-logger for a specific request\n  const logger = useLogging({ userId });\n\n  logger.info({\n    message: \"User login attempt\",\n    data: {\n      metadata: { method: \"oauth\" },\n    },\n  });\n}\n```\n\n## Custom Transports\n\nYou can easily implement your own transports by matching the `ITransport` interface.\n\n```typescript\nimport {\n  addTransport,\n  ConsoleTransport,\n  RemoteTransport,\n  type ITransport,\n  type TLog,\n} from \"@alcyone-labs/simple-logger\";\n\n// Add a remote logger\naddTransport(new RemoteTransport(\"https://logs.example.com\", \"error\"));\n\n// Add a console logger with debug level\naddTransport(new ConsoleTransport(\"debug\"));\n\n// Or implement your own\nclass MyCustomTransport implements ITransport {\n  constructor(public level = \"info\") {}\n  info(data: TLog) {\n    /* ... */\n  }\n  // ...\n}\n```\n\n## API Reference\n\n### `useLogging(metadata?: Record<string, any>)`\n\nReturns a logger object with `info`, `debug`, `warn`, and `error` methods. Any metadata passed here will be merged into every log message.\n\n### `configureLogger(options: { transports?: ITransport[] })`\n\nResets the logger configuration with a new set of transports.\n\n### `addTransport(transport: ITransport)`\n\nAdds a new transport to the existing list.\n\n### `TLog`\n\nThe type of the log message object, validated via Zod.\n\n```typescript\n{\n  message: string;\n  data: {\n    metadata?: Record<string, any>;\n    [key: string]: any;\n  }\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}