logquill 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +48 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -9,13 +9,15 @@ A logging framework for Node/TypeScript that shares one mental model and one
9
9
  JSON log shape with its Python sibling, [`logquill`](https://pypi.org/project/logquill/)
10
10
  (repo: `logquill-python`).
11
11
 
12
- Status: pre-release, under active development. The core `Logger`, level
13
- filtering, non-blocking async dispatch with configurable backpressure, a
14
- full plugin pipeline (context/redaction/PII/tamper-evidence/sampling/
15
- alerting), `JSONFormatter`, a broad transport catalog — console/file/
16
- HTTP, SQL, NoSQL, message queues, and cloud-native log platforms — and a
17
- separate `logquill/browser` build are implemented; see `CHANGELOG.md` for
18
- what's landed so far.
12
+ Status: **1.0** the full core `Logger`, level filtering, non-blocking
13
+ async dispatch with configurable backpressure, a full plugin pipeline
14
+ (context/redaction/PII/tamper-evidence/sampling/rate-limiting/alerting),
15
+ `JSONFormatter`, a broad transport catalog — console/file/HTTP, SQL,
16
+ NoSQL, message queues, and cloud-native log platforms — agentic/harness
17
+ tracing (including `LangChainAdapter`/`LangGraphAdapter` and
18
+ `OtelSpanProcessor`), a separate `logquill/browser` build, and
19
+ `winston`/`pino` migration bridges are all shipped; see `CHANGELOG.md` for
20
+ the full history.
19
21
 
20
22
  ## Features
21
23
 
@@ -29,6 +31,7 @@ what's landed so far.
29
31
  - **Dual package** — works via both `require()` (CJS) and `import` (ESM) from the same published package
30
32
  - **Tracing & agentic logging** — `.thought()/.action()/.observation()/.decision()`, `Logger.span()` for nested/durationMs-stamped spans, `RunPlugin` (per-run id + step counter), and `TraceContextPlugin` (cross-service `traceId`, OTel-aware) — see [Tracing & agentic logging](#tracing--agentic-logging)
31
33
  - **LangChain.js / LangGraph.js adapter** — `LangChainAdapter`, a `BaseCallbackHandler` that maps chain/LLM/tool/agent events onto the calls above with zero manual instrumentation, from a separate `logquill/langchain` entry point — see [Agentic framework adapters](#agentic-framework-adapters)
34
+ - **OpenTelemetry-native integration** — `OtelSpanProcessor` bridges frameworks that emit OTel spans directly (e.g. the Vercel AI SDK) onto `.action()`/`.observation()`/`.error()`, with zero real dependency on `@opentelemetry/*` — see [OpenTelemetry-native integration](#opentelemetry-native-integration)
32
35
  - **Non-blocking async dispatch** — a call returns before its write runs, via a bounded internal queue with a configurable backpressure policy (`dropOldest`/`dropNewest`/`block`); `logger.flush()`, `withLambda`/`withCloudFunction`/`withAzureFunction`, and `installShutdownHandlers` cover draining it before a process pauses or exits — see [Async dispatch & shutdown](#async-dispatch--shutdown)
33
36
  - **Request-scoped context propagation** — `bindContext()`, `AsyncLocalStorage`-backed, so a value set once is visible in every nested log call underneath it without threading it through every signature by hand; `RateLimitPlugin` caps a noisy loop without silencing everything else — see [Context propagation & error capture](#context-propagation--error-capture)
34
37
  - **Migration bridges** — `LogQuillWinstonTransport` (from `logquill/winston`) and `LogQuillPinoDestination` let an existing `winston`/`pino` app adopt LogQuill's transports/plugins with no call-site changes — see [Migration bridges](#migration-bridges)
@@ -51,6 +54,7 @@ what's landed so far.
51
54
  - [Rate limiting](#rate-limiting)
52
55
  - [Tracing & agentic logging](#tracing--agentic-logging)
53
56
  - [Agentic framework adapters](#agentic-framework-adapters)
57
+ - [OpenTelemetry-native integration](#opentelemetry-native-integration)
54
58
  - [Async dispatch & shutdown](#async-dispatch--shutdown)
55
59
  - [Kubernetes](#kubernetes)
56
60
  - [Context propagation & error capture](#context-propagation--error-capture)
@@ -652,6 +656,43 @@ not the main `"logquill"` import — because `LangChainAdapter` has to
652
656
  optional peer dependency) — no separate `@langchain/langgraph` dependency
653
657
  is needed for `LangGraphAdapter`.
654
658
 
659
+ ### OpenTelemetry-native integration
660
+
661
+ Some frameworks aren't callback-handler-based — the Vercel AI SDK's
662
+ `experimental_telemetry` is the main JS example, emitting OpenTelemetry
663
+ spans directly instead of calling into a handler object like
664
+ `BaseCallbackHandler`. `OtelSpanProcessor` covers that case: register it on
665
+ any OTel tracer provider, and every span becomes one `.action()` call on
666
+ start plus one `.observation()` (or `.error()`, on an error status) call on
667
+ end, carrying the span's own `spanId`/`parentSpanId` — OTel span ids are
668
+ already the same 16-hex-char shape LogQuill's own ids use — plus
669
+ `meta.durationMs` on the end record:
670
+
671
+ ```ts
672
+ import { BasicTracerProvider } from "@opentelemetry/sdk-trace-base";
673
+ import { Logger, OtelSpanProcessor } from "logquill";
674
+
675
+ const logger = new Logger("agent");
676
+ const provider = new BasicTracerProvider({
677
+ spanProcessors: [new OtelSpanProcessor(logger)],
678
+ });
679
+ const tracer = provider.getTracer("my-app");
680
+
681
+ const span = tracer.startSpan("callLlm");
682
+ span.end();
683
+ // logs two records: one .action() on start, one .observation() on end
684
+ // (or .error() if span.setStatus({ code: SpanStatusCode.ERROR }) was called)
685
+ ```
686
+
687
+ Unlike `LangChainAdapter`, this is exported from the **main** `"logquill"`
688
+ entry point, not a separate subpath — it's fully duck-typed against the
689
+ `Span`/`ReadableSpan` shape, the same approach `TraceContextPlugin` uses
690
+ for its own OTel lookup, so it never imports `@opentelemetry/api` or
691
+ `@opentelemetry/sdk-trace-base` for real. Non-empty span attributes are
692
+ copied onto `meta.attributes` (configurable via `attributesKey`) verbatim;
693
+ mapping onto the OTel `gen_ai.*` semantic conventions is left to the
694
+ planned `OTLPTransport` (v2.0).
695
+
655
696
  ## Async dispatch & shutdown
656
697
 
657
698
  Every `Logger` call returns before the write it triggers actually runs —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "logquill",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A logging framework with an identical mental model and JSON log shape across Node/TypeScript and Python.",
5
5
  "license": "MIT",
6
6
  "type": "module",