@cobol-ts/debug 0.0.14 → 0.0.16

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 +11 -7
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,15 +1,19 @@
1
1
  # @cobol-ts/debug
2
2
 
3
- ## Purpose
3
+ Build optional named debug loggers from a shared map of enable flags.
4
4
 
5
- This module supplies a named debug logger controlled by a shared map of enabled names. Its purpose is conditional diagnostics at call sites, not structured metrics or error propagation. The separate [metrics module](../metrics/README.md) counts predefined operations without formatting debug messages.
5
+ Debug messages are not hot-path counters; use `metrics` for deterministic operation measurement.
6
6
 
7
- ## Public abstractions
7
+ ## Logger lifecycle
8
8
 
9
- `DebugState` is a `NameAnd<boolean>` map from `@cobol-ts/records`. `makeDebugLog(debugState, name)` constructs a `DebugLog` function for that name. `DebugLog` also exposes additional functions; consult [`src/debug.ts`](src/debug.ts) for their signatures and severity behaviour. `createMockDebugLog()` is a test-friendly implementation provided by [`src/debug.mock.ts`](src/debug.mock.ts).
9
+ `makeDebugLog(debugState, name)` creates a named logger whose enabled state is decided when the logger is created. `createMockDebugLog()` provides a test implementation.
10
10
 
11
- Loggers capture their name, and check the debug state when the logger is created; changing the map later does not retroactively enable an already-created logger. Use a single state map when diagnostics across components need coordinated control. Do not rely on debug output for production correctness, counters or deterministic benchmark measurement.
11
+ Use `MemoryMetrics` instead of debug strings when comparing per-record operation counts; the logger is for human-readable diagnostics rather than deterministic measurement.
12
12
 
13
- ## Related modules
13
+ ## Source and tests
14
14
 
15
- The shared record-map type is in [records](../records/README.md), while [test_utils](../test_utils/README.md) can capture console output in tests.
15
+ **Public entry points:** [debug.mock.ts](./src/debug.mock.ts), [debug.ts](./src/debug.ts).
16
+
17
+ **Tests:** [debug.log.spec.ts](src/debug.log.spec.ts)
18
+
19
+ **Related:** [@cobol-ts/metrics](../metrics/README.md) · [@cobol-ts/records](../records/README.md).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cobol-ts/debug",
3
3
  "description": "Debug utilities ",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index",
7
7
  "browserslist": {
@@ -17,7 +17,7 @@
17
17
  ]
18
18
  },
19
19
  "dependencies": {
20
- "@cobol-ts/records": "0.0.14"
20
+ "@cobol-ts/records": "0.0.16"
21
21
  },
22
22
  "devDependencies": {
23
23
  "typescript": "^5.2.2",