@ultimat3/core 31.25.0 → 31.26.0
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/README.md +1 -1
- package/package.json +2 -2
- package/src/exports/observability.ts +1 -0
- package/src/index.ts +1 -0
- package/src/logger.ts +5 -0
- package/src/registrar.ts +1 -0
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ JSON.stringify({ dsn }); // the value never prints: a Secret redacts by value, a
|
|
|
75
75
|
| an app's role-scoped boot line — `bootWarning({ code, roles, once?, message, fields })`, said only where a booting role can act on it, `once: 'process'` or `'build'` (the boot installs the per-build store with `installBootWarnings`, on `@ultimat3/core/adapter`) | `boot-warning.ts` |
|
|
76
76
|
| `Clock` — the only source of "now" | `clock.ts` |
|
|
77
77
|
| UUIDv7, nanoid, branded ids | `ids.ts` |
|
|
78
|
-
| structured JSON logging + redaction; `installLogSink(sink)` — the test seam that sends every default-writer line to a sink instead of the process's streams until the release it returns runs (a stack: releases in any order; `undefined` is the streams) (a test preload drops them; a test asserting on the process logger collects them). The tee is the bus: every such line, redacted, is the `log.record` event — `subscribe('log.record', handler)` | `logger.ts` |
|
|
78
|
+
| structured JSON logging + redaction; `installLogSink(sink)` — the test seam that sends every default-writer line to a sink instead of the process's streams until the release it returns runs (a stack: releases in any order; `undefined` is the streams) (a test preload drops them; a test asserting on the process logger collects them). The tee is the bus: every such line, redacted, is the `log.record` event — `subscribe('log.record', handler)`; `setLogStream('stderr')` moves default-writer lines below `error` off stdout, `currentLogStream()` reads it back so a caller that sets it for a span restores it | `logger.ts` |
|
|
79
79
|
| a condition that KEEPS failing, said rarely: `outageLog({ event, level })` → `failed()` writes on failures 1, 2, 4, 8, …, `recovered()` one `<event> recovered` line with `after`; `failureStreak({ event, recoveredEvent, level?, fields? })` → `failed(error, fields?)` writes once per CAUSE (code, or uncoded message; a new one carries `previous`), `passed()` one `recoveredEvent` line with `failures`, `reset()` for a restarted loop; `failureFields(error)` — the `error`/`code`/`cause`/`fix` a failure line carries | `outage-log.ts` |
|
|
80
80
|
| `teeLogLines(tee)` → its release: a COPY of every process-logger line (redacted, as written) handed to `tee(line, level)` beside the streams, never instead of them. A set: each release removes only its own tee; a tee that throws loses only its copy. `x dev`'s `dev.log` is the caller | `logger.ts` |
|
|
81
81
|
| `redactValues([{ pattern, replace }])` — redaction by VALUE: every match of each `g` pattern becomes `replace` in a log line's message and field strings and in the Sentry envelope's exception value, `fix`, `stack`, extras and `meta`, a span's exception event and status, and failure bundles. Bumps the same generation as `redactKeys`, so a logger bound before it re-redacts. A sticky pattern, an empty match or a repeated group holding a repeating quantifier (`(a+)+`, `(a+){2,40}`) is refused at registration — `RedactPatternUnsafeError` (`X_REDACT_PATTERN_UNSAFE`) — and the list with it. Ships no pattern; `RedactValueMatcher` is the type | `logger-redact.ts`, `redact-values.ts` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/core",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.26.0",
|
|
4
4
|
"description": "Ultimate's foundation: errors, context, env, config, clock, ids, logging, telemetry, lifecycle",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"test": "bun test"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@ultimat3/schema": "31.
|
|
57
|
+
"@ultimat3/schema": "31.26.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -105,6 +105,7 @@ export { SEMCONV, SEMCONV_METRICS, SEMCONV_VALUES } from '../instrument-semconv'
|
|
|
105
105
|
export { callerStack, captureStatementStacks, resetStatementStacks } from '../instrument-stacks';
|
|
106
106
|
export type { LogFields, Logger, LoggerOptions, LogLevel, RedactValueMatcher } from '../logger';
|
|
107
107
|
export {
|
|
108
|
+
currentLogStream,
|
|
108
109
|
isRedactedKey,
|
|
109
110
|
LOG_LEVELS,
|
|
110
111
|
logger,
|
package/src/index.ts
CHANGED
package/src/logger.ts
CHANGED
|
@@ -83,6 +83,11 @@ export function setLogStream(stream: 'stdout' | 'stderr'): void {
|
|
|
83
83
|
logStream = stream;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
/** The stream `setLogStream` last chose: what a caller that sets it for a span puts back after. */
|
|
87
|
+
export function currentLogStream(): 'stdout' | 'stderr' {
|
|
88
|
+
return logStream;
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
/** What `installLogSink` installs: one complete JSON line, and the level it was written at. */
|
|
87
92
|
export type LogSink = (line: string, level: LogLevel) => void;
|
|
88
93
|
|
package/src/registrar.ts
CHANGED
|
@@ -98,6 +98,7 @@ export const PRIMITIVE_FACTORIES = Object.freeze<readonly PrimitiveFactory[]>(
|
|
|
98
98
|
{ factory: 'subjectExport', pkg: '@ultimat3/jobs', kind: 'job' },
|
|
99
99
|
{ factory: 'webhook', pkg: '@ultimat3/jobs', kind: 'job' },
|
|
100
100
|
{ factory: 'webhookReceiver', pkg: '@ultimat3/jobs', kind: 'job' },
|
|
101
|
+
{ factory: 'inboundMail', pkg: '@ultimat3/mail', kind: 'job' },
|
|
101
102
|
{ factory: 'mcpConfirmations', pkg: '@ultimat3/mcp', kind: 'action' },
|
|
102
103
|
{ factory: 'notifier', pkg: '@ultimat3/notify', kind: 'job' },
|
|
103
104
|
{ factory: 'pushRegister', pkg: '@ultimat3/notify', kind: 'action' },
|