logixlysia 6.9.2 → 6.9.4
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.
- package/CHANGELOG.md +21 -0
- package/README.md +8 -7
- package/dist/axiom.d.ts +1 -1
- package/dist/axiom.js +3 -3
- package/dist/better-stack.d.ts +1 -1
- package/dist/better-stack.js +3 -3
- package/dist/clickhouse.d.ts +1 -1
- package/dist/clickhouse.js +3 -3
- package/dist/datadog.d.ts +1 -1
- package/dist/datadog.js +3 -3
- package/dist/desertant.js +3 -3
- package/dist/enrichers.js +3 -3
- package/dist/hyperdx.d.ts +1 -1
- package/dist/hyperdx.js +2 -2
- package/dist/index.d.ts +11 -8
- package/dist/index.js +7 -7
- package/dist/loki.d.ts +1 -1
- package/dist/loki.js +3 -3
- package/dist/otel.d.ts +5 -1
- package/dist/otel.js +1 -1
- package/dist/otlp.d.ts +1 -1
- package/dist/otlp.js +2 -2
- package/dist/posthog.d.ts +1 -1
- package/dist/posthog.js +2 -2
- package/dist/sentry.d.ts +1 -1
- package/dist/sentry.js +3 -3
- package/dist/shared/Logixlysia-1ap5daz6.js +6 -0
- package/dist/shared/Logixlysia-b7f18pfw.js +5 -0
- package/dist/shared/Logixlysia-kwnc1c9b.js +5 -0
- package/package.json +20 -17
- package/dist/shared/Logixlysia-a59b921j.js +0 -5
- package/dist/shared/Logixlysia-jvphdjgs.js +0 -5
- package/dist/shared/Logixlysia-nrt7tysy.js +0 -6
package/dist/index.d.ts
CHANGED
|
@@ -242,7 +242,7 @@ type LogPreset = "dev" | "prod" | "json";
|
|
|
242
242
|
/** Context passed to {@link Options.config.onError} when a sink fails. */
|
|
243
243
|
interface SinkErrorContext {
|
|
244
244
|
error: unknown;
|
|
245
|
-
sink: "enricher" | "file" | "rotation" | "shutdown" | "transport";
|
|
245
|
+
sink: "enricher" | "file" | "format" | "rotation" | "shutdown" | "transport";
|
|
246
246
|
}
|
|
247
247
|
interface RequestIdConfig {
|
|
248
248
|
/**
|
|
@@ -312,9 +312,10 @@ interface OutputConfig {
|
|
|
312
312
|
logFilePath?: string;
|
|
313
313
|
logRotation?: LogRotationConfig;
|
|
314
314
|
/**
|
|
315
|
-
* Called when a sink (transport, file, rotation) or an enricher fails
|
|
316
|
-
*
|
|
317
|
-
*
|
|
315
|
+
* Called when a sink (transport, file, rotation) or an enricher fails, or
|
|
316
|
+
* when building or printing a log record fails (`sink: 'format'`). Errors
|
|
317
|
+
* thrown by the hook itself are swallowed. When absent, failures go to
|
|
318
|
+
* stderr (rate-limited for transports, enrichers and formatting).
|
|
318
319
|
*/
|
|
319
320
|
onError?: (context: SinkErrorContext) => void;
|
|
320
321
|
transports?: Transport[];
|
|
@@ -350,7 +351,7 @@ interface RequestTrackingConfig {
|
|
|
350
351
|
* into the request context, so the fields reach the console tree, file logs,
|
|
351
352
|
* and every transport at once.
|
|
352
353
|
*
|
|
353
|
-
* Each entry is either an
|
|
354
|
+
* Each entry is either an `Enricher` (a `request` phase, a `response`
|
|
354
355
|
* phase, or both) or a bare function, which is treated as the request phase.
|
|
355
356
|
* Ready-made ones — traceparent, user agent, geo, sizes — live in
|
|
356
357
|
* `logixlysia/enrichers`.
|
|
@@ -372,7 +373,8 @@ interface RequestTrackingConfig {
|
|
|
372
373
|
requestId?: boolean | RequestIdConfig;
|
|
373
374
|
/**
|
|
374
375
|
* Enable request-scoped logger propagation via AsyncLocalStorage.
|
|
375
|
-
* When enabled,
|
|
376
|
+
* When enabled, `useLogger()` returns the current request's logger anywhere in the request's async call chain.
|
|
377
|
+
* The handler context's `log` is available either way.
|
|
376
378
|
* @default false
|
|
377
379
|
*/
|
|
378
380
|
useAsyncLocalStorage?: boolean;
|
|
@@ -420,6 +422,7 @@ interface WebSocketLike {
|
|
|
420
422
|
};
|
|
421
423
|
};
|
|
422
424
|
readonly id?: string;
|
|
425
|
+
readonly raw?: object;
|
|
423
426
|
}
|
|
424
427
|
interface WsHandlerHooks<
|
|
425
428
|
TMessage = unknown,
|
|
@@ -511,7 +514,7 @@ interface SamplingRuntime {
|
|
|
511
514
|
*
|
|
512
515
|
* @param random Injectable for deterministic tests; defaults to `Math.random`.
|
|
513
516
|
*/
|
|
514
|
-
declare const resolveSampling: (config
|
|
517
|
+
declare const resolveSampling: (config?: SamplingConfig, random?: () => number) => SamplingRuntime | undefined;
|
|
515
518
|
/**
|
|
516
519
|
* Empty singleton slots must not use `Record<string, never>`: intersecting that with Elysia's `Context`
|
|
517
520
|
* makes every key (including `store`) become `never` because each key is merged with `never`.
|
|
@@ -536,7 +539,7 @@ type LogixlysiaPlugin<TFields extends object = LogFields> = Logixlysia<TFields>
|
|
|
536
539
|
wrapWs: ReturnType<typeof createWsHandlerWrapper>;
|
|
537
540
|
};
|
|
538
541
|
/**
|
|
539
|
-
* @
|
|
542
|
+
* @template TFields - Field bag for the request-scoped `log`. Supply your own
|
|
540
543
|
* interface to have TypeScript reject misspelled context keys; the default
|
|
541
544
|
* allows any key, so untyped usage is unchanged.
|
|
542
545
|
*/
|