{"_id":"@airo-js/log","_rev":"4-58901f8194d90342b59a1303a9249331","name":"@airo-js/log","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"@airo-js/log","version":"0.1.0","keywords":["airo","framework","log","logger","events","observability","devtools-sink"],"author":{"name":"AI/RO contributors"},"license":"Apache-2.0","_id":"@airo-js/log@0.1.0","maintainers":[{"name":"ben.smith","email":"ben.smith@dotter.me"}],"homepage":"https://github.com/airo-studio/airo-js/tree/main/packages/log#readme","bugs":{"url":"https://github.com/airo-studio/airo-js/issues"},"dist":{"shasum":"0ceab000df5e8b7e20b679e037b68072590bb379","tarball":"https://registry.npmjs.org/@airo-js/log/-/log-0.1.0.tgz","fileCount":8,"integrity":"sha512-04o+2EHcbA28SdAwIHjOiesS7gxGSPucznphSuWDuExfg9lXCK2g/ALUC/0SBu5bQcqYQlkccbCedC0gFSdUYw==","signatures":[{"sig":"MEUCIGnSiYHco4Knm6KefpkrCGw4OnHNwZ3nGoUp00v3w0uEAiEAmBQpQ03bB3LiJUarowJTMxfYud2TaSq4AaOZ+3xLk7Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36445},"main":"./dist/index.js","type":"module","_from":"file:airo-js-log-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"ben.smith","email":"ben.smith@dotter.me"},"_resolved":"/private/var/folders/c5/n9tshghx1rn9q47jkjlw9q4m0000gp/T/c160c39aba1a9ca79362478ec20b393c/airo-js-log-0.1.0.tgz","_integrity":"sha512-04o+2EHcbA28SdAwIHjOiesS7gxGSPucznphSuWDuExfg9lXCK2g/ALUC/0SBu5bQcqYQlkccbCedC0gFSdUYw==","repository":{"url":"git+https://github.com/airo-studio/airo-js.git","type":"git","directory":"packages/log"},"_npmVersion":"11.4.2","description":"Airo log — sink-based structured event logging for the airo-js framework. Replaces scattered console.* calls across @airo-js/* packages with a single dispatcher; apps replace the sink to feed events into devtools panels, Sentry, Datadog, or stay with the ","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/log_0.1.0_1778328818216_0.1993174954622352","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@airo-js/log","version":"0.2.0","keywords":["airo","framework","log","logger","events","observability","devtools-sink"],"author":{"name":"AI/RO contributors"},"license":"Apache-2.0","_id":"@airo-js/log@0.2.0","maintainers":[{"name":"ben.smith","email":"ben.smith@dotter.me"}],"homepage":"https://github.com/airo-studio/airo-js/tree/main/packages/log#readme","bugs":{"url":"https://github.com/airo-studio/airo-js/issues"},"dist":{"shasum":"ca1b0feb735a31a936e19a286b2a11348ecc9f6a","tarball":"https://registry.npmjs.org/@airo-js/log/-/log-0.2.0.tgz","fileCount":8,"integrity":"sha512-78X6tK34rQdGcQnmFUWIheI2yCzAwgufoZnN9GKmzQ6dzgUXGRs0sr8zA3m41cvWNDdrA6HfWoyznhM1sUfeaA==","signatures":[{"sig":"MEUCIQC6CCxiaLMus5MSlOcG07YuzSF+wXAHzsg0AUAqkXZr1AIgc0dp+zeuVMN3GpAFypLKiyvtjhPJkXu9SFCKF3+9kmg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44952},"main":"./dist/index.js","type":"module","_from":"file:airo-js-log-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"ben.smith","email":"ben.smith@dotter.me"},"_resolved":"/private/var/folders/c5/n9tshghx1rn9q47jkjlw9q4m0000gp/T/408cc80cdb850dd70d107f0eaf15d96f/airo-js-log-0.2.0.tgz","_integrity":"sha512-78X6tK34rQdGcQnmFUWIheI2yCzAwgufoZnN9GKmzQ6dzgUXGRs0sr8zA3m41cvWNDdrA6HfWoyznhM1sUfeaA==","repository":{"url":"git+https://github.com/airo-studio/airo-js.git","type":"git","directory":"packages/log"},"_npmVersion":"11.4.2","description":"Airo log — sink-based structured event logging for the airo-js framework. Replaces scattered console.* calls across @airo-js/* packages with a single dispatcher; apps replace the sink to feed events into devtools panels, Sentry, Datadog, or stay with the ","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/log_0.2.0_1779724142264_0.21795020712986912","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@airo-js/log","version":"0.3.0","keywords":["airo","framework","log","logger","events","observability","devtools-sink"],"author":{"name":"AI/RO contributors"},"license":"Apache-2.0","_id":"@airo-js/log@0.3.0","maintainers":[{"name":"ben.smith","email":"ben.smith@dotter.me"}],"homepage":"https://github.com/airo-studio/airo-js/tree/main/packages/log#readme","bugs":{"url":"https://github.com/airo-studio/airo-js/issues"},"dist":{"shasum":"204cd31b13e64a75b180933b9714b64228e75d36","tarball":"https://registry.npmjs.org/@airo-js/log/-/log-0.3.0.tgz","fileCount":8,"integrity":"sha512-24F0nadJdtVwSzP0UeTSlGk17x0j7m52dkniryTsDO1bWNQ4Kd8bzFTZAGJDD67l2H384Dfuj8k/edgurMsE9w==","signatures":[{"sig":"MEUCIDRVsr20rXYqZURISrJhPptlmcd8WLFCd8R6cT5mNmC7AiEA8NUfd+6PQsneJ6Wul0FpqODZILMLUtE7HFM2RcsqnYk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70749},"main":"./dist/index.js","type":"module","_from":"file:airo-js-log-0.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"ben.smith","email":"ben.smith@dotter.me"},"_resolved":"/private/var/folders/c5/n9tshghx1rn9q47jkjlw9q4m0000gp/T/599f46d6dce036a0fb62ed3c9152daf5/airo-js-log-0.3.0.tgz","_integrity":"sha512-24F0nadJdtVwSzP0UeTSlGk17x0j7m52dkniryTsDO1bWNQ4Kd8bzFTZAGJDD67l2H384Dfuj8k/edgurMsE9w==","repository":{"url":"git+https://github.com/airo-studio/airo-js.git","type":"git","directory":"packages/log"},"_npmVersion":"11.4.2","description":"Airo log — sink-based structured event logging for the airo-js framework. Replaces scattered console.* calls across @airo-js/* packages with a single dispatcher; apps replace the sink to feed events into devtools panels, Sentry, Datadog, or stay with the ","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/log_0.3.0_1784907786439_0.1770333793815202","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@airo-js/log","version":"0.3.1","description":"Airo log — sink-based structured event logging for the airo-js framework. Replaces scattered console.* calls across @airo-js/* packages with a single dispatcher; apps replace the sink to feed events into devtools panels, Sentry, Datadog, or stay with the ","keywords":["airo","framework","log","logger","events","observability","devtools-sink"],"author":{"name":"AI/RO contributors"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/airo-studio/airo-js.git","directory":"packages/log"},"homepage":"https://github.com/airo-studio/airo-js/tree/main/packages/log#readme","bugs":{"url":"https://github.com/airo-studio/airo-js/issues"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","clean":"rm -rf dist *.tsbuildinfo"},"_id":"@airo-js/log@0.3.1","_integrity":"sha512-/Ht1mdGV74uBQsRpm/50MyJKjoD6OhvalHv2wrgrT4hpC8ac3N0eXfXXJogqDmozEq/+YmN3YG4R63cx/u169A==","_resolved":"/private/var/folders/c5/n9tshghx1rn9q47jkjlw9q4m0000gp/T/c693a79ccb860c389249cfee2b378987/airo-js-log-0.3.1.tgz","_from":"file:airo-js-log-0.3.1.tgz","_nodeVersion":"24.3.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-/Ht1mdGV74uBQsRpm/50MyJKjoD6OhvalHv2wrgrT4hpC8ac3N0eXfXXJogqDmozEq/+YmN3YG4R63cx/u169A==","shasum":"03edad3b00b3530227df3ca1a71706cfe8d2fba3","tarball":"https://registry.npmjs.org/@airo-js/log/-/log-0.3.1.tgz","fileCount":8,"unpackedSize":74265,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGXYLvqwzk+qg9PWsRJNfnr17GZFKOeItxpWZ3GicGd7AiAegxX1RBfYmzpBJ14iOOSiYex/dzI+ShFV+SmeBv7how=="}]},"_npmUser":{"name":"ben.smith","email":"ben.smith@dotter.me"},"directories":{},"maintainers":[{"name":"ben.smith","email":"ben.smith@dotter.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/log_0.3.1_1788594107546_0.3835180990288898"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-09T12:13:38.119Z","modified":"2026-09-05T07:41:47.848Z","0.1.0":"2026-05-09T12:13:38.405Z","0.2.0":"2026-05-25T15:49:02.416Z","0.3.0":"2026-07-24T15:43:06.589Z","0.3.1":"2026-09-05T07:41:47.669Z"},"bugs":{"url":"https://github.com/airo-studio/airo-js/issues"},"author":{"name":"AI/RO contributors"},"license":"Apache-2.0","homepage":"https://github.com/airo-studio/airo-js/tree/main/packages/log#readme","keywords":["airo","framework","log","logger","events","observability","devtools-sink"],"repository":{"type":"git","url":"git+https://github.com/airo-studio/airo-js.git","directory":"packages/log"},"description":"Airo log — sink-based structured event logging for the airo-js framework. Replaces scattered console.* calls across @airo-js/* packages with a single dispatcher; apps replace the sink to feed events into devtools panels, Sentry, Datadog, or stay with the ","maintainers":[{"name":"ben.smith","email":"ben.smith@dotter.me"}],"readme":"# `@airo-js/log`\n\nSink-based structured event logging for the airo-js framework. Replaces scattered `console.*` calls across `@airo-js/*` packages with a single dispatcher; apps replace the sink to feed events into devtools panels, Sentry, Datadog, or stay with the default console behaviour.\n\n> Status: **v0.1.0**. Stable surface. Layer 1 of the framework devtools story (the dispatcher + structured event types). A separate `@airo-js/devtools` panel that consumes the sink will follow.\n\n## What this is\n\nA dependency-free leaf package that the rest of `@airo-js/*` emits into:\n\n- **`logger(channel)`** — returns a `ChannelLogger` with `debug` / `info` / `warn` / `error` methods. Framework packages call this at module scope.\n- **`AiroEvent`** — structured event shape (timestamp, channel, level, message, optional phase / widgetId / cartridgeId / data / error).\n- **`AiroSink`** — `{ emit(event): void }`. Replaceable.\n- **`consoleSink`** (default) — preserves existing `[@airo-js/<channel>] <msg>` console behaviour verbatim.\n- **`noopSink`** — for tests.\n- **`setSink` / `getSink` / `resetSink`** — sink management.\n\n## Why a sink\n\nThree real consumer needs the framework couldn't address before:\n\n1. **Forward framework lifecycle events to existing observability** — Sentry breadcrumbs, Datadog logs, OpenTelemetry spans. Without the sink, every consumer would have to monkey-patch `console`.\n2. **In-page devtools panels** — a panel subscribes to events and renders a live stream / state inspector. The sink is the panel's data source.\n3. **Test noise control** — replace the sink with `noopSink` in unit tests so framework warnings don't flood test output.\n\n## Default behaviour: identical to today\n\n```ts\n// @airo-js/embed today (post-retrofit):\nimport { logger } from '@airo-js/log';\nconst log = logger('embed');\n\nlog.warn(`'${elementName}' already registered; skipping.`);\n// → console.warn('[@airo-js/embed]', \"'<name>' already registered; skipping.\")\n```\n\nThe default `consoleSink` produces output indistinguishable from the previous `console.warn('[@airo-js/embed] ...')` lines. Apps that never call `setSink` see zero behavioural change.\n\n### The default threshold is `'warn'`\n\nTwo filters run in order and it is worth knowing which is which: the **level threshold** decides whether an event is dispatched at all, and only then does the **sink** decide how to render it. Replacing the sink does not lower the threshold.\n\n`warn` and `error` are on by default; `debug` and `info` are narration and are off. Turn them on per surface with `setLogLevel('debug')`, per channel with `setChannelLevel('runtime', 'debug')`, or from the URL with `?airo-log=` (see below). A host that wants production quiet calls `setLogLevel('error')`.\n\n> **0.3.0 shipped this as `'error'` and that was a bug**, fixed in 0.3.1. It silenced every framework warning at once — including \"Router init failed; URL routing disabled\" — while this README claimed the opposite. If you pinned `0.3.0` and added a `setLogLevel('warn')` of your own, you can drop it.\n\n## Replacing the sink\n\n```ts\nimport { setSink, type AiroSink } from '@airo-js/log';\n\nconst sentrySink: AiroSink = {\n  emit(event) {\n    Sentry.addBreadcrumb({\n      category: `airo:${event.channel}`,\n      level: event.level,\n      message: event.msg,\n      data: { ...event.data, phase: event.phase, widgetId: event.widgetId },\n    });\n    if (event.level === 'error' && event.err) {\n      Sentry.captureException(new Error(event.err.message));\n    }\n  },\n};\n\nsetSink(sentrySink);\n```\n\nOr multiplex — log to console *and* capture to a ring buffer for the devtools panel:\n\n```ts\nimport { consoleSink, setSink, type AiroEvent } from '@airo-js/log';\n\nconst ringBuffer: AiroEvent[] = [];\nconst RING_SIZE = 500;\n\nsetSink({\n  emit(event) {\n    consoleSink.emit(event);\n    ringBuffer.push(event);\n    if (ringBuffer.length > RING_SIZE) ringBuffer.shift();\n  },\n});\n\n// ringBuffer is the data source for the devtools panel.\n```\n\n## Channel taxonomy\n\n| Channel | Source |\n|---|---|\n| `core` | `@airo-js/core` (event bus, page manager, pipeline, router) |\n| `runtime` | `@airo-js/runtime` |\n| `embed` | `@airo-js/embed` |\n| `ssr` | `@airo-js/ssr` |\n| `cartridge-kit` | `@airo-js/cartridge-kit` |\n| `mcp` | `@airo-js/mcp` |\n| `app` | Apps emit their own structured events on this channel |\n\nThe `phase` field is free-form — typical values: `'shell' | 'gate' | 'fetch' | 'pipeline' | 'mount'` for runtime mount lifecycle, page ids for navigation, gate ids for blocked-by-X warnings.\n\n## What this is NOT\n\n- Not a replacement for thrown errors — throws still propagate to the caller via promise rejection / try-catch. The sink is for *side-channel* observability (warnings, recoverable errors, lifecycle phases that don't throw).\n- Not a metrics or telemetry pipeline — sinks can forward to one, but this package doesn't ship the forwarding logic.\n- Not a logger framework with formatters / appenders / log4j-style hierarchies — it's a single sink with structured events. Complexity belongs in the sink implementation, not the dispatcher.\n\n## License\n\nApache-2.0 — same as the rest of `@airo-js/*`.\n","readmeFilename":"README.md"}