Package Exports
- @contractspec/lib.logger
- @contractspec/lib.logger/context
- @contractspec/lib.logger/context.browser
- @contractspec/lib.logger/context.node
- @contractspec/lib.logger/elysia-plugin
- @contractspec/lib.logger/formatters
- @contractspec/lib.logger/index.browser
- @contractspec/lib.logger/logger
- @contractspec/lib.logger/logger.browser
- @contractspec/lib.logger/logger.node
- @contractspec/lib.logger/timer
- @contractspec/lib.logger/tracer
- @contractspec/lib.logger/tracer.browser
- @contractspec/lib.logger/tracer.node
- @contractspec/lib.logger/types
Readme
@contractspec/lib.logger
Website: https://contractspec.io
Comprehensive logging library optimized for Bun with ElysiaJS integration.
What It Provides
- Layer: lib.
- Consumers: email, jobs, contracts-runtime-server-mcp, bundles, apps.
- Related ContractSpec packages include
@contractspec/tool.bun,@contractspec/tool.typescript. - Related ContractSpec packages include
@contractspec/tool.bun,@contractspec/tool.typescript.
Installation
npm install @contractspec/lib.logger
or
bun add @contractspec/lib.logger
Usage
Import the root entrypoint from @contractspec/lib.logger, or choose a documented subpath when you only need one part of the package surface.
Architecture
src/context.browser.tsis part of the package's public or composition surface.src/context.node.tsis part of the package's public or composition surface.src/context.tsis part of the package's public or composition surface.src/elysia-plugin.tsis part of the package's public or composition surface.src/formatters.tsis part of the package's public or composition surface.src/index.browser.tsis part of the package's public or composition surface.src/index.tsis the root public barrel and package entrypoint.src/types.tsis shared public type definitions.
Public Entry Points
- Export
.resolves throughtypes,browser,default. - Export
./contextresolves throughtypes,browser,node, ... - Export
./context.browserresolves through./src/context.browser.ts. - Export
./context.noderesolves through./src/context.node.ts. - Export
./elysia-pluginresolves through./src/elysia-plugin.ts. - Export
./formattersresolves through./src/formatters.ts. - Export
./index.browserresolves through./src/index.browser.ts. - Export
./loggerresolves throughtypes,browser,node, ... - Export
./logger.browserresolves through./src/logger.browser.ts. - Export
./logger.noderesolves through./src/logger.node.ts. - The package publishes 15 total export subpaths; keep docs aligned with
package.json.
Local Commands
bun run dev— contractspec-bun-build devbun run build— bun run prebuild && bun run build:bundle && bun run build:typesbun run lint— bun run lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run typecheck— tsc --noEmitbun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rm -rf distbun run build:bundle— contractspec-bun-build transpilebun run build:types— contractspec-bun-build typesbun run prebuild— contractspec-bun-build prebuild
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
Notes
- Logger interface is used across the entire stack — breaking changes affect everything.
- Structured log format must stay JSON-compatible for log aggregation pipelines.
- Elysia plugin must not break the middleware chain; preserve
onRequest/onAfterHandleorder.