@btravstack/observability 0.16.0 → 0.17.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/dist/index.cjs CHANGED
@@ -21,8 +21,6 @@ const logLevel = (options = {}) => {
21
21
  parse: (raw) => text.parse(raw).ensure(isLevel, (value) => new _btravstack_config.ConfigFieldInvalid({ reason: `must be one of ${_btravstack_core.LEVELS.join(", ")}, got ${JSON.stringify(value)}` }))
22
22
  };
23
23
  };
24
- /** The schema `observability()` binds `LoggerConfig` through — one field today, and the place a second one lands. */
25
- const loggerSchema = (level) => _btravstack_config.Config.object({ level: _btravstack_config.Config.pinned(level, logLevel()) });
26
24
  //#endregion
27
25
  //#region src/json-sink.ts
28
26
  /**
@@ -115,7 +113,6 @@ const createLogger = (sink, level = "info") => {
115
113
  } catch {}
116
114
  };
117
115
  return {
118
- log: (lineLevel, message, attributes, cause) => write(lineLevel, message, attributes, cause),
119
116
  trace: (message, attributes, cause) => write("trace", message, attributes, cause),
120
117
  debug: (message, attributes, cause) => write("debug", message, attributes, cause),
121
118
  info: (message, attributes, cause) => write("info", message, attributes, cause),
@@ -151,7 +148,7 @@ var LoggerConfig = class extends (0, _btravstack_di.Port)("LoggerConfig") {};
151
148
  const observability = (options = {}) => (0, _btravstack_di.Module)("Observability")({
152
149
  needs: [_btravstack_config.Env],
153
150
  provides: [
154
- _btravstack_config.Config.provider(LoggerConfig)(loggerSchema(options.level)),
151
+ _btravstack_config.Config.provider(LoggerConfig)(_btravstack_config.Config.object({ level: _btravstack_config.Config.pinned(options.level, logLevel()) })),
155
152
  (0, _btravstack_di.Provider)(_btravstack_core.Logger)({
156
153
  inject: { config: LoggerConfig },
157
154
  sync: ({ config }) => createLogger(options.sink ?? jsonSink(), config.level)
package/dist/index.mjs CHANGED
@@ -20,8 +20,6 @@ const logLevel = (options = {}) => {
20
20
  parse: (raw) => text.parse(raw).ensure(isLevel, (value) => new ConfigFieldInvalid({ reason: `must be one of ${LEVELS.join(", ")}, got ${JSON.stringify(value)}` }))
21
21
  };
22
22
  };
23
- /** The schema `observability()` binds `LoggerConfig` through — one field today, and the place a second one lands. */
24
- const loggerSchema = (level) => Config.object({ level: Config.pinned(level, logLevel()) });
25
23
  //#endregion
26
24
  //#region src/json-sink.ts
27
25
  /**
@@ -114,7 +112,6 @@ const createLogger = (sink, level = "info") => {
114
112
  } catch {}
115
113
  };
116
114
  return {
117
- log: (lineLevel, message, attributes, cause) => write(lineLevel, message, attributes, cause),
118
115
  trace: (message, attributes, cause) => write("trace", message, attributes, cause),
119
116
  debug: (message, attributes, cause) => write("debug", message, attributes, cause),
120
117
  info: (message, attributes, cause) => write("info", message, attributes, cause),
@@ -150,7 +147,7 @@ var LoggerConfig = class extends Port("LoggerConfig") {};
150
147
  const observability = (options = {}) => Module("Observability")({
151
148
  needs: [Env],
152
149
  provides: [
153
- Config.provider(LoggerConfig)(loggerSchema(options.level)),
150
+ Config.provider(LoggerConfig)(Config.object({ level: Config.pinned(options.level, logLevel()) })),
154
151
  Provider(Logger)({
155
152
  inject: { config: LoggerConfig },
156
153
  sync: ({ config }) => createLogger(options.sink ?? jsonSink(), config.level)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btravstack/observability",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Observability for @btravstack/core: a strict Logger port correlated with the kernel's units, a dependency-free JSON sink, and the lifecycle events as log lines",
5
5
  "keywords": [
6
6
  "dependency-injection",
@@ -65,27 +65,27 @@
65
65
  "./package.json": "./package.json"
66
66
  },
67
67
  "devDependencies": {
68
- "@btravstack/config": "0.16.0",
69
- "@btravstack/core": "0.16.0",
70
- "@btravstack/di": "0.16.0",
71
- "@btravstack/testing": "0.16.0",
68
+ "@btravstack/config": "0.17.0",
69
+ "@btravstack/core": "0.17.0",
70
+ "@btravstack/di": "0.17.0",
71
+ "@btravstack/testing": "0.17.0",
72
72
  "@btravstack/tsconfig": "0.4.0",
73
73
  "@opentelemetry/api": "1.9.1",
74
74
  "@opentelemetry/sdk-node": "0.222.0",
75
75
  "@opentelemetry/sdk-trace": "2.11.0",
76
- "@types/node": "26.4.1",
77
- "@unthrown/vitest": "5.8.0",
78
- "@vitest/coverage-v8": "4.1.11",
79
- "pino": "10.3.1",
76
+ "@types/node": "26.6.4",
77
+ "@unthrown/vitest": "5.12.0",
78
+ "@vitest/coverage-v8": "5.0.3",
79
+ "pino": "10.4.0",
80
80
  "tsdown": "0.23.0",
81
81
  "typescript": "7.0.2",
82
- "unthrown": "5.8.0",
83
- "vitest": "4.1.11"
82
+ "unthrown": "5.12.0",
83
+ "vitest": "5.0.3"
84
84
  },
85
85
  "peerDependencies": {
86
- "@btravstack/config": "^0.16.0",
87
- "@btravstack/core": "^0.16.0",
88
- "@btravstack/di": "^0.16.0",
86
+ "@btravstack/config": "^0.17.0",
87
+ "@btravstack/core": "^0.17.0",
88
+ "@btravstack/di": "^0.17.0",
89
89
  "@opentelemetry/api": "^1.9.0",
90
90
  "@opentelemetry/sdk-node": "^0.222.0",
91
91
  "pino": "^10",