@webpieces/winston 0.4.607 → 0.4.609
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 +6 -2
- package/package.json +3 -3
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
package/README.md
CHANGED
|
@@ -28,8 +28,12 @@ const loggerFactory = process.env.K_SERVICE
|
|
|
28
28
|
? new WinstonGcpFactory()
|
|
29
29
|
: new WinstonConsoleFactory();
|
|
30
30
|
|
|
31
|
-
// Typically you pass loggerFactory to
|
|
32
|
-
//
|
|
31
|
+
// Typically you pass loggerFactory to
|
|
32
|
+
// setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', 'deployed', loggerFactory, ...)),
|
|
33
|
+
// which calls ServiceInfo.setInfo(...), RuntimeLocality.declare(...), HeaderRegistry.configure(...)
|
|
34
|
+
// then LogManager.setFactory(loggerFactory) for you. The 3rd argument is WHERE this process runs
|
|
35
|
+
// ('local' | 'deployed'); it decides whether @AuthLocalOnly endpoints exist, and it is required so
|
|
36
|
+
// no server can boot without saying.
|
|
33
37
|
```
|
|
34
38
|
|
|
35
39
|
Both factories read the magic context **directly** from `RequestContext` on each line, so
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/winston",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.609",
|
|
4
4
|
"description": "Node-only winston LoggerFactory backends for webpieces: Console (local pretty) + GCP (Cloud Run stdout JSON), auto-enriched with HeaderRegistry context keys",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@webpieces/core-util": "0.4.
|
|
27
|
-
"@webpieces/core-context": "0.4.
|
|
26
|
+
"@webpieces/core-util": "0.4.609",
|
|
27
|
+
"@webpieces/core-context": "0.4.609",
|
|
28
28
|
"winston": "3.11.0",
|
|
29
29
|
"logform": "2.7.0",
|
|
30
30
|
"safe-stable-stringify": "2.5.0"
|
package/src/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* ? new WinstonGcpFactory() // Cloud Run → stdout JSON
|
|
12
12
|
* : new WinstonConsoleFactory(); // local → pretty console
|
|
13
13
|
* // setupRuntime identifies the service (name+version are REQUIRED inputs) and installs the backend:
|
|
14
|
-
* // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', loggerFactory, ...))
|
|
14
|
+
* // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', 'deployed', loggerFactory, ...))
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
17
|
* (svcName rides winston `defaultMeta`, read at factory CONSTRUCTION — so if you need it on winston
|
package/src/index.js
CHANGED
|
@@ -14,7 +14,7 @@ exports.localPrettyFormat = exports.severityFormat = exports.injectContextFormat
|
|
|
14
14
|
* ? new WinstonGcpFactory() // Cloud Run → stdout JSON
|
|
15
15
|
* : new WinstonConsoleFactory(); // local → pretty console
|
|
16
16
|
* // setupRuntime identifies the service (name+version are REQUIRED inputs) and installs the backend:
|
|
17
|
-
* // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', loggerFactory, ...))
|
|
17
|
+
* // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', 'deployed', loggerFactory, ...))
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
20
|
* (svcName rides winston `defaultMeta`, read at factory CONSTRUCTION — so if you need it on winston
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/logging/winston/src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AACjC,iDAAkE;AAAzD,8GAAA,aAAa,OAAA;AAAE,iHAAA,gBAAgB,OAAA;AACxC,mCAMkB;AALd,2GAAA,iBAAiB,OAAA;AACjB,0GAAA,gBAAgB,OAAA;AAChB,6GAAA,mBAAmB,OAAA;AACnB,wGAAA,cAAc,OAAA;AACd,2GAAA,iBAAiB,OAAA","sourcesContent":["/**\n * @webpieces/winston\n *\n * Node-only winston {@link LoggerFactory} backends for webpieces. Install one at\n * startup via `LogManager.setFactory(...)`:\n *\n * ```ts\n * import { WinstonGcpFactory, WinstonConsoleFactory } from '@webpieces/winston';\n *\n * const loggerFactory = process.env.K_SERVICE\n * ? new WinstonGcpFactory() // Cloud Run → stdout JSON\n * : new WinstonConsoleFactory(); // local → pretty console\n * // setupRuntime identifies the service (name+version are REQUIRED inputs) and installs the backend:\n * // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', loggerFactory, ...))\n * ```\n *\n * (svcName rides winston `defaultMeta`, read at factory CONSTRUCTION — so if you need it on winston\n * lines, call `ServiceInfo.setInfo('my-service', '2.1.0')` before building the factory too; `version`\n * is stamped per-record and appears the moment setupRuntime runs regardless of construction order.)\n *\n * BREAKING (was `new WinstonFactoryOptions(svcGitHash)` passed to each factory): the version moved\n * to `ServiceInfo.setInfo(name, version)` in @webpieces/core-util, because it is a fact about the\n * SERVICE, not about winston — bunyan needs the same version and previously could not stamp one at\n * all. It is also no longer presumed to be a git SHA: `version` is opaque, so a project deploying\n * semver or CI build numbers is no longer misdescribed. Migration: delete the `WinstonFactoryOptions`\n * import, call `ServiceInfo.setInfo(<name>, <the same hash>)` before building the factory, and drop\n * the ctor argument. A forgotten call throws at startup. Note the field renamed `svcGitHash` →\n * `version`, so GCP log filters/alerts on `jsonPayload.svcGitHash` must be updated.\n *\n * Both backends auto-enrich every line with the logged context keys, read\n * DIRECTLY from the active RequestContext (@webpieces/core-context) on each line —\n * no ContextReader is threaded in. Every line also carries `svcName` + `version` from ServiceInfo,\n * though neither renders in the LOCAL pretty format (you know your own service, and can check git).\n *\n * @packageDocumentation\n */\nexport { WinstonGcpFactory } from './WinstonGcpFactory';\nexport { WinstonConsoleFactory } from './WinstonConsoleFactory';\nexport { ChunkingConsoleTransport } from './ChunkingConsoleTransport';\nexport { WinstonLogger, LEVEL_TO_WINSTON } from './WinstonLogger';\nexport {\n LEVEL_TO_SEVERITY,\n bigIntSafeFormat,\n injectContextFormat,\n severityFormat,\n localPrettyFormat,\n} from './format';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/logging/winston/src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AACjC,iDAAkE;AAAzD,8GAAA,aAAa,OAAA;AAAE,iHAAA,gBAAgB,OAAA;AACxC,mCAMkB;AALd,2GAAA,iBAAiB,OAAA;AACjB,0GAAA,gBAAgB,OAAA;AAChB,6GAAA,mBAAmB,OAAA;AACnB,wGAAA,cAAc,OAAA;AACd,2GAAA,iBAAiB,OAAA","sourcesContent":["/**\n * @webpieces/winston\n *\n * Node-only winston {@link LoggerFactory} backends for webpieces. Install one at\n * startup via `LogManager.setFactory(...)`:\n *\n * ```ts\n * import { WinstonGcpFactory, WinstonConsoleFactory } from '@webpieces/winston';\n *\n * const loggerFactory = process.env.K_SERVICE\n * ? new WinstonGcpFactory() // Cloud Run → stdout JSON\n * : new WinstonConsoleFactory(); // local → pretty console\n * // setupRuntime identifies the service (name+version are REQUIRED inputs) and installs the backend:\n * // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', 'deployed', loggerFactory, ...))\n * ```\n *\n * (svcName rides winston `defaultMeta`, read at factory CONSTRUCTION — so if you need it on winston\n * lines, call `ServiceInfo.setInfo('my-service', '2.1.0')` before building the factory too; `version`\n * is stamped per-record and appears the moment setupRuntime runs regardless of construction order.)\n *\n * BREAKING (was `new WinstonFactoryOptions(svcGitHash)` passed to each factory): the version moved\n * to `ServiceInfo.setInfo(name, version)` in @webpieces/core-util, because it is a fact about the\n * SERVICE, not about winston — bunyan needs the same version and previously could not stamp one at\n * all. It is also no longer presumed to be a git SHA: `version` is opaque, so a project deploying\n * semver or CI build numbers is no longer misdescribed. Migration: delete the `WinstonFactoryOptions`\n * import, call `ServiceInfo.setInfo(<name>, <the same hash>)` before building the factory, and drop\n * the ctor argument. A forgotten call throws at startup. Note the field renamed `svcGitHash` →\n * `version`, so GCP log filters/alerts on `jsonPayload.svcGitHash` must be updated.\n *\n * Both backends auto-enrich every line with the logged context keys, read\n * DIRECTLY from the active RequestContext (@webpieces/core-context) on each line —\n * no ContextReader is threaded in. Every line also carries `svcName` + `version` from ServiceInfo,\n * though neither renders in the LOCAL pretty format (you know your own service, and can check git).\n *\n * @packageDocumentation\n */\nexport { WinstonGcpFactory } from './WinstonGcpFactory';\nexport { WinstonConsoleFactory } from './WinstonConsoleFactory';\nexport { ChunkingConsoleTransport } from './ChunkingConsoleTransport';\nexport { WinstonLogger, LEVEL_TO_WINSTON } from './WinstonLogger';\nexport {\n LEVEL_TO_SEVERITY,\n bigIntSafeFormat,\n injectContextFormat,\n severityFormat,\n localPrettyFormat,\n} from './format';\n"]}
|