@webex/plugin-logger 3.12.0 → 3.13.0-next.2

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.
@@ -0,0 +1,18 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: standing-doc
3
+ generated_from: adr-index@0.3.0
4
+ generated_by: claude-cowork
5
+ approved_by: akulakum@cisco.com
6
+ updated_at: 2026-10-08T08:51:39Z
7
+ validation_status: pass-with-warnings
8
+ -->
9
+
10
+ # Architectural decision records
11
+
12
+ Durable decisions for this package. The module specification owns current behavior. An ADR owns why a documentation or structural choice was made.
13
+
14
+ ## Index
15
+
16
+ | ADR | Title | Status |
17
+ | --- | ----- | ------ |
18
+ | [0001](0001-retain-product-readme.md) | Retain the product README and treat code as the behavioral authority | Accepted |
@@ -0,0 +1,263 @@
1
+ ---
2
+ type: Architecture
3
+ title: '@webex/plugin-logger architecture'
4
+ description: Package-wide boundaries, resources, interactions, dependencies, and cross-cutting architecture.
5
+ tags: [architecture]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: architecture@0.3.0
10
+ generated_by: claude-cowork
11
+ approved_by: akulakum@cisco.com
12
+ updated_at: 2026-10-08T08:51:39Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # @webex/plugin-logger architecture
17
+
18
+ Canonical architecture for this package. Logger behavior lives in the [module specification](../src/docs/README.md). This page owns package boundaries, the plugin registration, the published contract, and how logs leave the package.
19
+
20
+ Related context: [specification registry](specs/README.md) · [package agent instructions](../AGENTS.md)
21
+
22
+ ## Applicability
23
+
24
+ | Condition ID | Status | Evidence or reason | Owned section |
25
+ | ------------ | ------ | ------------------ | ------------- |
26
+ | `repo.owns_datastore` | N/A | No database, file store, or migration in `src/` | Repository data and schema |
27
+ | `repo.holds_client_state` | Applicable | `Logger` keeps three in-memory buffers and a group counter as session state | Client state model |
28
+ | `repo.components_interact` | Applicable | `src/index.js` registers `src/logger.js` with `src/config.js` through `@webex/webex-core` | Dependency and interaction topology |
29
+ | `repo.domain_data_across_components` | N/A | One plugin owns the buffers. No shared domain record. | Object and data ownership |
30
+ | `repo.caches_data` | N/A | Buffers are bounded history, not a cache of fetched data | Caching catalog |
31
+ | `repo.observability_convention` | Applicable | This package is the SDK logging convention: levels, names, redaction, and buffered upload | Observability patterns |
32
+ | `repo.deploys_to_infra` | N/A | Library published to npm. No service runtime. | Runtime and infrastructure |
33
+ | `repo.shared_base_libs` | Applicable | `@webex/webex-core`, `@webex/common`, and `lodash` are runtime dependencies | Shared and base libraries |
34
+ | `repo.is_monorepo` | N/A | This SDD root is one package. The workspace around it is out of scope. | Package map and inter-package dependencies |
35
+ | `repo.multi_platform` | Applicable | `inBrowser` switches console output; tests run under jest (Node) and karma (browser) | Platform matrix |
36
+ | `repo.published_package` | Applicable | `package.json` `name` is `@webex/plugin-logger` and `deploy:npm` publishes it | Release and versioning |
37
+ | `repo.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
38
+ | `repo.exposes_commands_or_artifacts` | Applicable | `build:src` writes `dist/`; `formatLogs` produces the upload text | Commands and generated artifacts |
39
+ | `repo.cross_repo_deps_material` | Applicable | Behavior depends on sibling workspace packages outside this SDD root | Cross-repository topology |
40
+ | `repo.security_arch_warranted` | Applicable | Redaction keeps tokens and personal data out of console and uploaded logs | Security architecture |
41
+
42
+ ## Design overview
43
+
44
+ `@webex/plugin-logger` is a published library with one module. Importing it registers `Logger` as the `logger` child of every webex instance, replacing the minimal logger that `@webex/webex-core` registers in `src/plugins/logger.js`. Callers use `webex.logger.<level>()` for SDK logs and `webex.logger.client_<level>()` for client logs.
45
+
46
+ Each call decides printing and buffering separately, redacts a deep clone of the message arguments, prints through `console`, and appends to a bounded buffer. `@webex/internal-plugin-support` later reads the buffer through `formatLogs` and uploads it.
47
+
48
+ The package does not start a server, open a network connection, or persist data.
49
+
50
+ ## Record consumers and host console
51
+
52
+ - `getRecords()` returns new record wrappers from retained history, in sequence order. It leaves support-upload cursors unchanged.
53
+ - Records contain `sequence`, `timestamp`, `level`, `source` and `body`. Time is SDK acceptance time in Unix milliseconds.
54
+ - Use `webex.logger.on('log:record', listener)` for future retained records. Use `off('log:record', listener)` to remove the same listener.
55
+ - Events run synchronously. Listeners must not throw or log back into the same logger synchronously. Nested events can reach later listeners out of order.
56
+ - `config.logger.metadataField` selects caller metadata for `source`, `eventName` and `attributes`. Callers must supply safe values and leave them unchanged.
57
+ - Optional `config.logger.consoleMethods` maps normal method names to saved names on `console`. Buffered calls use the named function to avoid a duplicate host-capture record.
58
+ - Printed-only calls and unavailable saved methods use normal console methods. Print and buffer thresholds stay unchanged.
59
+ - The SDK owns retained history. Consumers own conversion and delivery. This package adds no OTel dependency, export queue or HTTP request.
60
+
61
+ ## Resource inventory and responsibilities
62
+
63
+ | Resource | Kind | Responsibility | Owner | Source | Detailed specification |
64
+ | -------- | ---- | -------------- | ----- | ------ | ---------------------- |
65
+ | Logger plugin module | module | Levels, redaction, buffers, formatting | @webex/web-client, @webex/web-sdk | `src/` | `src/docs/README.md` |
66
+ | Published package | package | npm entry points and registration side effect | @webex/web-client, @webex/web-sdk | `package.json` | `docs/architecture.md` |
67
+
68
+ ## Interaction and execution flows
69
+
70
+ ```mermaid
71
+ flowchart LR
72
+ importer[Package importer]
73
+ index[src_index_js]
74
+ core[webex_core_registerPlugin]
75
+ logger[src_logger_js]
76
+ config[src_config_js]
77
+ plugins[SDK plugins]
78
+ support[internal_plugin_support]
79
+ consoleOut[console]
80
+ importer --> index
81
+ index --> core
82
+ index --> logger
83
+ index --> config
84
+ plugins --> logger
85
+ logger --> consoleOut
86
+ support --> logger
87
+ ```
88
+
89
+ | From | To | Interaction or transport | Purpose | Failure or compatibility behavior |
90
+ | ---- | -- | ------------------------ | ------- | --------------------------------- |
91
+ | Importer | `src/index.js` | package import | Side-effect registration | Without the import, `webex.logger` stays the webex-core fallback |
92
+ | `src/index.js` | `@webex/webex-core` `registerPlugin` | in-process call with `replace: true` and `config` | Install `Logger` and merge defaults | Without `replace`, registration is skipped |
93
+ | SDK plugins | `webex.logger` | synchronous method call | Write logs | Methods never throw |
94
+ | `webex.logger` | `console` | synchronous call with fallbacks | Developer output | Missing console methods fall back |
95
+ | `@webex/internal-plugin-support` | `webex.logger` | `formatLogs`, `updateLastSubmittedIndex`, `resetBufferToLastSuccessfulUpload` | Upload logs | A failed diff upload rewinds `nextIndex` when retry is configured |
96
+
97
+ ## Dependency topology
98
+
99
+ Runtime dependencies declared in `package.json` and imported from `src/`:
100
+
101
+ | Dependency | Role |
102
+ | ---------- | ---- |
103
+ | `@webex/webex-core` | `WebexPlugin` base class and `registerPlugin` |
104
+ | `@webex/common` | `inBrowser` and `patterns` |
105
+ | `lodash@^4.17.21` | `cloneDeep`, `has`, `isArray`, `isObject`, `isString` |
106
+
107
+ `@webex/test-helper-chai`, `@webex/test-helper-mocha`, and `@webex/test-helper-mock-webex` are also listed under `dependencies`, but only `test/` imports them.
108
+
109
+ ## Public and consumer surfaces
110
+
111
+ | Contract id | Publication | Kind | Canonical source | Owning spec |
112
+ | ----------- | ----------- | ---- | ---------------- | ----------- |
113
+ | `plugin-logger-sdk` | published | sdk | `package.json` | `src/docs/README.md` |
114
+ | `log-buffer-format` | internal | file | `src/logger.js` | `src/docs/README.md` |
115
+ | `webex-core-plugin-host` | internal | rpc | `@webex/webex-core` | external |
116
+ | `webex-common-js-api` | published | sdk | `@webex/common` | `packages/@webex/common/src/docs/README.md` |
117
+ | `lodash` | published | sdk | npm package `lodash` | external |
118
+
119
+ `plugin-logger-sdk` entry points:
120
+
121
+ - `main`: `dist/index.js`
122
+ - `devMain`: `src/index.js`
123
+ - exports: default `Logger` and named `levels`
124
+
125
+ No HTTP surface exists, so `api-specs/openapi.yaml` is omitted.
126
+
127
+ Known in-repo consumers: `packages/@webex/internal-plugin-support/src/support.js` uses `formatLogs` and both cursor methods. `packages/webex/src/webex.js`, `packages/webex-node/src/webex-node.js`, and `packages/@webex/contact-center/src/webex.js` import the package for registration.
128
+
129
+ ## Client state model
130
+
131
+ | State or slice | Owner | Transition triggers | Persistence or reset boundary |
132
+ | -------------- | ----- | ------------------- | ----------------------------- |
133
+ | Log buffers (`buffer`, `sdkBuffer`, `clientBuffer`) | `Logger` | Buffered log calls; trimming at history length | In memory per webex instance. Lost on reload. |
134
+ | Upload cursors (`nextIndex`, `lastSubmitted`) | `Logger`, driven by `@webex/internal-plugin-support` | `formatLogs({diff: true})`, `updateLastSubmittedIndex`, `resetBufferToLastSuccessfulUpload` | In memory. Clamped at `0` when entries are trimmed. |
135
+ | `groupLevel` | `Logger` | Buffered `group` and `groupEnd` | In memory |
136
+
137
+ Details are in the module spec.
138
+
139
+ ## Cross-cutting architecture
140
+
141
+ ### Security
142
+
143
+ The trust boundary is the point where caller-supplied values leave the process: the console and the upload buffer. Message arguments pass through `Logger#filter`. Structured metadata passes through unchanged; callers must supply safe values. The controls and their gaps are listed under Security architecture.
144
+
145
+ The package does not authenticate users, store secrets, or verify certificates.
146
+
147
+ ### Observability and operations
148
+
149
+ This package is the SDK's logging layer; its signal conventions are under Observability patterns. Operationally, it has no runtime to deploy or monitor. A failure inside a log method is reported through `console.warn` with `failed to execute Logger#<level>` and does not reach the caller.
150
+
151
+ ### Quality attributes
152
+
153
+ - Compatibility: level method names, `formatLogs`, the cursor methods, and the `config.logger` keys are relied on by workspace packages.
154
+ - Bounded memory: each buffer is trimmed to its history length on write.
155
+ - Non-throwing: log methods catch internal errors.
156
+
157
+ ## Dependency and interaction topology
158
+
159
+ One module. Files inside it:
160
+
161
+ ```mermaid
162
+ flowchart TD
163
+ indexJs[src_index_js]
164
+ loggerJs[src_logger_js]
165
+ configJs[src_config_js]
166
+ indexJs --> loggerJs
167
+ indexJs --> configJs
168
+ ```
169
+
170
+ `src/config.js` is not imported by `src/logger.js`. It reaches the logger as `this.config` after `registerPlugin` merges it.
171
+
172
+ ## Observability patterns
173
+
174
+ | Signal | Convention or required fields | Propagation or naming rule | Primary evidence |
175
+ | ------ | ----------------------------- | -------------------------- | ---------------- |
176
+ | Logs | Buffer entry `[indent, isoTimestamp, name, ...values]`, redacted before output | SDK name `wx-js-sdk`; client name from `config.logger.clientName`, default `client` | `src/logger.js` |
177
+ | Metrics | N/A — none emitted | — | `src/logger.js` |
178
+ | Traces | N/A — `trace` is a log level, not a span | — | `src/logger.js` |
179
+ | Audit | N/A — no audited actions | — | `src/logger.js` |
180
+
181
+ ## Shared and base libraries
182
+
183
+ | Inherited stack | What this package inherits | Source |
184
+ | --------------- | -------------------------- | ------ |
185
+ | `WebexPlugin` base class | Ampersand session state, `this.config` bound to `config.logger`, and the `this.webex` reference | `src/logger.js` |
186
+ | Legacy build and lint configs | `@webex/babel-config-legacy`, `@webex/eslint-config-legacy`, `@webex/jest-config-legacy` | `babel.config.js`, `.eslintrc.js`, `jest.config.js` |
187
+ | Legacy tooling | `webex-legacy-tools` build and test runners | `package.json` scripts |
188
+
189
+ ## Platform matrix
190
+
191
+ | Platform | Console output | Test runner |
192
+ | -------- | -------------- | ----------- |
193
+ | Node | Filtered arguments, objects as objects | jest via `test:unit` |
194
+ | Browser | Stringified arguments, objects as JSON strings | karma via `test:browser` |
195
+
196
+ `inBrowser` comes from `@webex/common` and is resolved by the bundler through that package's `browser` field.
197
+
198
+ ## Release and versioning
199
+
200
+ The package is published with `yarn workspace @webex/plugin-logger deploy:npm`. That script wraps Yarn's npm publish; the wrapped call is a script internal, not a separate manifest command. The license field is `MIT`. There is no package-local changelog; workspace release tooling owns changelog generation.
201
+
202
+ Export stability is described in the module spec.
203
+
204
+ ## Commands and generated artifacts
205
+
206
+ | Command | Produces |
207
+ | ------- | -------- |
208
+ | `yarn workspace @webex/plugin-logger build` | `dist/` from `src/` via `build:src` |
209
+ | `yarn workspace @webex/plugin-logger build:src` | `dist/` with source maps |
210
+ | `yarn workspace @webex/plugin-logger test:unit` | jest result; no committed artifact |
211
+ | `yarn workspace @webex/plugin-logger test:browser` | karma result; no committed artifact |
212
+ | `yarn workspace @webex/plugin-logger test:style` | eslint result; no committed artifact |
213
+ | `yarn install` | workspace `node_modules` |
214
+ | `yarn workspace @webex/plugin-logger deploy:npm` | npm publish |
215
+
216
+ At runtime, `formatLogs()` produces the log text described under Protocol and wire format in the module spec. `dist/` is generated. Do not edit it by hand.
217
+
218
+ ## Cross-repository topology
219
+
220
+ | Repository or external system | Relationship | Exchanged contract or artifact | Owner | Sequencing constraint |
221
+ | ----------------------------- | ------------ | ------------------------------ | ----- | --------------------- |
222
+ | `packages/@webex/webex-core` | Consumes | `webex-core-plugin-host` | @webex/web-client, @webex/web-sdk | webex-core must register its fallback logger first so `replace: true` can override it |
223
+ | `packages/@webex/common` | Consumes | `webex-common-js-api` | @webex/web-client, @webex/web-sdk | Changes to `patterns.containsEmails` or `containsMTID` change redaction here |
224
+ | `packages/@webex/internal-plugin-support` | Provides | `log-buffer-format` and cursor methods | @webex/web-client, @webex/web-sdk | Buffer or format changes must ship with support changes |
225
+
226
+ These are sibling workspace packages outside this package-scoped SDD root.
227
+
228
+ ## Security architecture
229
+
230
+ Threat addressed: tokens and personal data written to the console or included in uploaded logs.
231
+
232
+ Controls in `src/logger.js`:
233
+
234
+ - Deep clone of message arguments before redaction, so caller objects are not mutated.
235
+ - Removal of keys matching `/[Aa]uthorization/` at any depth.
236
+ - Replacement of email addresses with `[REDACTED]`.
237
+ - Replacement of `MTID=<value>` with `MTID=[REDACTED]`.
238
+ - Circular-reference guard during redaction and stringify.
239
+
240
+ Controls that are absent:
241
+
242
+ - `Error` arguments are passed through without redaction.
243
+ - Uppercase `AUTHORIZATION` keys are not removed.
244
+ - Repeated identical strings within one call are redacted only at their first occurrence.
245
+
246
+ ## Domain language
247
+
248
+ | Term | Meaning |
249
+ | ---- | ------- |
250
+ | SDK log | Entry written by `<level>()`; named `wx-js-sdk` |
251
+ | Client log | Entry written by `client_<level>()`; named by `config.logger.clientName` or `client` |
252
+ | Buffer | In-memory array of entries kept for upload |
253
+ | Diff | Entries added since the last `formatLogs({diff: true})` |
254
+ | `nextIndex` | Position where the next diff starts |
255
+ | `lastSubmitted` | `nextIndex` at the last successful upload |
256
+ | Redaction | Removing or masking sensitive values before output |
257
+
258
+ ## References and maintenance
259
+
260
+ - Module spec: `src/docs/README.md`
261
+ - Product readme decision: `docs/adr/0001-retain-product-readme.md`
262
+ - Owner: `@webex/web-client @webex/web-sdk` in the monorepo `.github/CODEOWNERS`
263
+ - Manifest: `.sdd/manifest.json`
@@ -0,0 +1,88 @@
1
+ ---
2
+ type: Getting Started
3
+ title: Getting started
4
+ description: Local setup, build, run, and test routing for @webex/plugin-logger.
5
+ tags: [onboarding]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: getting-started@0.3.0
10
+ generated_by: claude-cowork
11
+ approved_by: akulakum@cisco.com
12
+ updated_at: 2026-10-08T08:51:39Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Getting started
17
+
18
+ Onboarding for **@webex/plugin-logger**.
19
+
20
+ The unit spec is `test/unit/spec/logger.js`. `test:unit` runs it under jest in Node, and `test:browser` runs it under karma.
21
+
22
+ ## Prerequisites
23
+
24
+ | Tool or access | Version or requirement |
25
+ | -------------- | ---------------------- |
26
+ | Node.js | `>=18`, declared in `package.json` `engines` |
27
+ | Yarn | Workspaces are used, so install from the workspace root rather than this directory |
28
+ | Browser for `test:browser` | A local browser for the karma runner that `test:browser` starts through `@webex/legacy-tools` |
29
+ | Container, registry, VPN, or account | N/A — no external account is required to build, lint, or unit-test this package |
30
+
31
+ ## Install
32
+
33
+ Dependencies are resolved for the whole workspace, not per package:
34
+
35
+ ```bash
36
+ yarn install
37
+ ```
38
+
39
+ Run it from the workspace root.
40
+
41
+ ## Build
42
+
43
+ Compile sources to `dist/`:
44
+
45
+ ```bash
46
+ yarn workspace @webex/plugin-logger build
47
+ ```
48
+
49
+ `scripts.build` runs `build:src`, which uses the `@webex/legacy-tools` builder to compile `src/` into `dist/` with source maps. That builder call is a script internal. The manifest records `build:src` as the compile role and `build` as the package role.
50
+
51
+ ## Run
52
+
53
+ N/A — library package with no start script.
54
+
55
+ Import the package from a consumer. `webex` and `webex-node` import it so that `webex.logger` is this plugin.
56
+
57
+ ## Tests
58
+
59
+ | Tier | Command | What it covers |
60
+ | ---- | ------- | -------------- |
61
+ | Unit (Node) | `yarn workspace @webex/plugin-logger test:unit` | `test/unit/spec/logger.js` under jest, including `nodeOnly` cases |
62
+ | Unit (browser) | `yarn workspace @webex/plugin-logger test:browser` | The same spec under karma, including `browserOnly` cases. Recorded as manifest `commands.browser-test` (role `other`) because the SDD manifest `tests` schema has no browser tier (`unit`, `integration`, `e2e`, `qa` only). |
63
+ | Lint | `yarn workspace @webex/plugin-logger test:style` | eslint over `src/` |
64
+ | Integration | N/A — `package.json` does not define `test:integration` | — |
65
+
66
+ Do not use `package.json` `scripts.test` as a verification command. It chains `test:integration`, which is not defined.
67
+
68
+ ## Configuration and secrets
69
+
70
+ | Item | Where it lives |
71
+ | ---- | -------------- |
72
+ | `WEBEX_LOG_LEVEL` | Environment variable. Read once into `config.logger.level` by `src/config.js` and again on each call by `getCurrentLevel` in `src/logger.js`. |
73
+ | `NODE_ENV` | `test` forces level `trace` when no level is configured and enables test-only output tweaks |
74
+ | `config.logger.*` | `level`, `clientLevel`, `bufferLogLevel`, `historyLength`, `clientHistoryLength`, `separateLogBuffers`, `clientName`. Defaults for `level` and `historyLength` are in `src/config.js`. |
75
+ | Secrets | N/A — this package reads no credentials. It removes `authorization` keys from logged values. |
76
+
77
+ ## First-run verification
78
+
79
+ 1. `yarn install` from the workspace root.
80
+ 2. `yarn workspace @webex/plugin-logger build`
81
+ 3. `yarn workspace @webex/plugin-logger test:style`
82
+ 4. `yarn workspace @webex/plugin-logger test:unit`
83
+
84
+ ## Next steps
85
+
86
+ - [Architecture](architecture.md)
87
+ - [Module specification](../src/docs/README.md)
88
+ - [Specification registry](specs/README.md)
package/docs/index.md ADDED
@@ -0,0 +1,42 @@
1
+ ---
2
+ okf_version: "0.1"
3
+ ---
4
+ <!-- sdd-generated-metadata
5
+ doc_kind: standing-doc
6
+ generated_from: docs-index@0.3.0
7
+ generated_by: claude-cowork
8
+ approved_by: akulakum@cisco.com
9
+ updated_at: 2026-10-08T08:51:39Z
10
+ validation_status: pass-with-warnings
11
+ -->
12
+
13
+ # @webex/plugin-logger documentation
14
+
15
+ Doc map for developers and agents.
16
+
17
+ This package publishes the Webex SDK logger plugin. It prints leveled output to `console`, redacts authorization keys, email addresses, and MTID values, and keeps bounded in-memory buffers that `@webex/internal-plugin-support` formats and uploads.
18
+
19
+ ## Start here
20
+
21
+ - [Getting started](getting-started.md)
22
+ - [Package architecture](architecture.md)
23
+ - [Module specification](../src/docs/README.md) — behavior of `src/`
24
+
25
+ ## Decisions
26
+
27
+ - [adr/](adr/) — architectural decision records
28
+
29
+ ## Specifications and contracts
30
+
31
+ - [architecture.md](architecture.md) — canonical package-wide architecture
32
+ - [specs/README.md](specs/README.md) — manifest-backed module and contract registry
33
+ - `src/docs/README.md` — the owning specification beside the module's code
34
+ - [adr/](adr/) — concrete architectural decisions
35
+
36
+ No deployable service exists in this package, so no service specification is generated. The published contract is an npm/SDK surface whose authoritative source is `package.json` together with `src/index.js`, not an OpenAPI document.
37
+
38
+ ## Related repository resources
39
+
40
+ - `README.md` — the package's npm-facing usage document, retained separately from this generated documentation set. See [ADR 0001](adr/0001-retain-product-readme.md).
41
+
42
+ No `ci/`, `operate/`, `diagrams/`, or runbook directories exist in this package.
@@ -0,0 +1,65 @@
1
+ ---
2
+ type: Reference
3
+ title: Specification registry
4
+ description: Canonical specification registry and change-routing guide.
5
+ tags: [specifications, registry]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: standing-doc
9
+ generated_from: spec-index@0.3.0
10
+ generated_by: claude-cowork
11
+ approved_by: akulakum@cisco.com
12
+ updated_at: 2026-10-08T08:51:39Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Specification registry
17
+
18
+ Use this page to find the canonical package architecture and the instantiated module specification. Keep technical facts in the owning document.
19
+
20
+ Start with the [package architecture](../architecture.md). No service specification exists here: this package is a library published to npm, not a deployable service, so that artifact is omitted in `.sdd/manifest.json`.
21
+
22
+ ## Document roles
23
+
24
+ | Document | Canonical ownership |
25
+ | -------- | ------------------- |
26
+ | [Package architecture](../architecture.md) | Package boundaries, resource inventory, interactions, dependency topology, and cross-cutting architecture |
27
+ | Service specification | Not applicable — no deployable service exists in this package |
28
+ | Module specifications | Stable behavior and design at each manifest-routed module spec |
29
+ | [ADR](../adr/) | A durable decision, its rationale, and consequences |
30
+
31
+ ## Instantiated specification registry
32
+
33
+ | Resource | Role | Canonical path | Owner | Status | Last verified |
34
+ | -------- | ---- | -------------- | ----- | ------ | ------------- |
35
+ | Package | Architecture | `docs/architecture.md` | @webex/web-client, @webex/web-sdk | Active | 2026-10-06 |
36
+ | Logger plugin | Module | `src/docs/README.md` | @webex/web-client, @webex/web-sdk | Draft | 2026-10-06 |
37
+ | `plugin-logger-sdk` | Contract | `package.json` | @webex/web-client, @webex/web-sdk | Active | 2026-10-06 |
38
+ | `log-buffer-format` | Contract | `src/logger.js` | @webex/web-client, @webex/web-sdk | Active | 2026-10-06 |
39
+
40
+ ### Module registry
41
+
42
+ | Module | Responsibility | Manifest coverage state | Start here |
43
+ | --- | --- | --- | --- |
44
+ | `src` | Leveled console logging, redaction, bounded buffers, and upload formatting | Partial | `src/docs/README.md` |
45
+
46
+ Generator-side field measurement is complete. Field coverage measured 2026-10-06 is 93.8% (15 of 16 mandatory fields PRESENT). Critical fields are 8 of 8 PRESENT. The WEAK field is test strategy: registration, the non-throwing catch branch, group indentation, and the documented redaction gaps have no unit test. Coverage state stays `Partial` until independent validation runs and a spec-drift record exists.
47
+
48
+ ## Change and verification routing
49
+
50
+ | Change affects | Load and update | Verification route |
51
+ | -------------- | --------------- | ------------------ |
52
+ | Package boundaries or cross-cutting architecture | `docs/architecture.md` and applicable ADRs | `yarn workspace @webex/plugin-logger test:unit` and `yarn workspace @webex/plugin-logger test:style` |
53
+ | A deployable service surface or operating posture | Not applicable — no deployable service exists in this package | Not applicable |
54
+ | A stable code or package boundary | `src/docs/README.md` | `yarn workspace @webex/plugin-logger test:unit` |
55
+ | Redaction, levels, buffers, or `formatLogs` output | The module spec plus `src/logger.js`; check `@webex/internal-plugin-support` | Unit spec, then `yarn workspace @webex/plugin-logger test:browser` |
56
+
57
+ ## Module and contract registration
58
+
59
+ The only module is `src`, with canonical spec `src/docs/README.md`.
60
+
61
+ `plugin-logger-sdk` is published. Its ecosystem-native artifact is `package.json`. Per-export behavior is specified in the module spec and implemented in `src/`. No OpenAPI document applies, which is why `api-specs/openapi.yaml` is omitted.
62
+
63
+ `log-buffer-format` is internal. Its source is `src/logger.js`, and its consumer is `@webex/internal-plugin-support`.
64
+
65
+ `webex-core-plugin-host`, `webex-common-js-api`, and `lodash` are external required contracts. They are not implemented in this package.
package/index.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /** Public record contracts for consumers; the legacy Logger constructor remains unchanged. */
2
+ export type LogValue =
3
+ | string
4
+ | number
5
+ | boolean
6
+ | null
7
+ | undefined
8
+ | Uint8Array
9
+ | LogValue[]
10
+ | LogAttributes;
11
+ export interface LogAttributes {
12
+ [key: string]: LogValue;
13
+ }
14
+ /**
15
+ * Optional producer fields. Callers supply safe, serializable data.
16
+ * SDK text redaction does not sanitize these fields.
17
+ * Callers and consumers must leave these values unchanged after logging.
18
+ */
19
+ export interface LogMetadata {
20
+ readonly source?: string;
21
+ readonly eventName?: string;
22
+ readonly attributes?: Readonly<LogAttributes>;
23
+ }
24
+ export interface LogRecord extends LogMetadata {
25
+ /** Logger-wide order. Increases once for each accepted buffered entry. */
26
+ readonly sequence: number;
27
+ /** Time the SDK accepted the entry, in Unix milliseconds. */
28
+ readonly timestamp: number;
29
+ /** Original SDK log level. The consumer maps it to its own severity. */
30
+ readonly level: string;
31
+ /** Producer label; defaults to sdk or client. It does not select the logging policy. */
32
+ readonly source: string;
33
+ /** Existing formatted text after SDK redaction. */
34
+ readonly body: string;
35
+ }
36
+
37
+ // Set logger.logAttributes to shared attributes for future records; explicit record attributes win.
38
+ // Each record copies the attribute map. Nested values must remain unchanged after logging.
39
+ // Keep existing JavaScript callers and instance-type imports compatible.
40
+ declare const Logger: any;
41
+ type Logger = InstanceType<typeof Logger>;
42
+ export default Logger;
43
+ export declare const levels: string[];
package/package.json CHANGED
@@ -24,20 +24,20 @@
24
24
  "@webex/eslint-config-legacy": "0.0.0",
25
25
  "@webex/jest-config-legacy": "0.0.0",
26
26
  "@webex/legacy-tools": "0.0.0",
27
- "@webex/test-helper-chai": "3.12.0",
28
- "@webex/test-helper-mocha": "3.12.0",
29
- "@webex/test-helper-mock-webex": "3.12.0",
30
- "@webex/test-helper-test-users": "3.12.0",
27
+ "@webex/test-helper-chai": "3.12.0-next.13",
28
+ "@webex/test-helper-mocha": "3.12.0-next.13",
29
+ "@webex/test-helper-mock-webex": "3.12.0-next.13",
30
+ "@webex/test-helper-test-users": "3.12.0-next.13",
31
31
  "eslint": "^8.24.0",
32
32
  "prettier": "^2.7.1",
33
33
  "sinon": "^9.2.4"
34
34
  },
35
35
  "dependencies": {
36
- "@webex/common": "3.12.0",
37
- "@webex/test-helper-chai": "3.12.0",
38
- "@webex/test-helper-mocha": "3.12.0",
39
- "@webex/test-helper-mock-webex": "3.12.0",
40
- "@webex/webex-core": "3.12.0",
36
+ "@webex/common": "3.12.0-next.13",
37
+ "@webex/test-helper-chai": "3.12.0-next.13",
38
+ "@webex/test-helper-mocha": "3.12.0-next.13",
39
+ "@webex/test-helper-mock-webex": "3.12.0-next.13",
40
+ "@webex/webex-core": "3.13.0-next.2",
41
41
  "lodash": "^4.17.21"
42
42
  },
43
43
  "scripts": {
@@ -49,5 +49,6 @@
49
49
  "test:style": "eslint ./src/**/*.*",
50
50
  "test:unit": "webex-legacy-tools test --unit --runner jest"
51
51
  },
52
- "version": "3.12.0"
52
+ "types": "index.d.ts",
53
+ "version": "3.13.0-next.2"
53
54
  }