@webpieces/bunyan 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 CHANGED
@@ -29,8 +29,12 @@ const loggerFactory = process.env.K_SERVICE
29
29
  ? new BunyanGcpFactory()
30
30
  : new BunyanConsoleFactory();
31
31
 
32
- // Typically you pass loggerFactory to setupRuntime(new RuntimeSetupOptions(loggerFactory, ...)),
33
- // which calls HeaderRegistry.configure(...) then LogManager.setFactory(loggerFactory) for you.
32
+ // Typically you pass loggerFactory to
33
+ // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', 'deployed', loggerFactory, ...)),
34
+ // which calls ServiceInfo.setInfo(...), RuntimeLocality.declare(...), HeaderRegistry.configure(...)
35
+ // then LogManager.setFactory(loggerFactory) for you. The 3rd argument is WHERE this process runs
36
+ // ('local' | 'deployed'); it decides whether @AuthLocalOnly endpoints exist, and it is required so
37
+ // no server can boot without saying.
34
38
  ```
35
39
 
36
40
  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/bunyan",
3
- "version": "0.4.607",
3
+ "version": "0.4.609",
4
4
  "description": "Node-only bunyan LoggerFactory backends for webpieces: Console (local pretty) + GCP (@google-cloud/logging-bunyan), 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.607",
27
- "@webpieces/core-context": "0.4.607",
26
+ "@webpieces/core-util": "0.4.609",
27
+ "@webpieces/core-context": "0.4.609",
28
28
  "bunyan": "1.8.15",
29
29
  "@google-cloud/logging-bunyan": "5.1.0",
30
30
  "@types/bunyan": "1.8.11"
package/src/index.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  * ? new BunyanGcpFactory() // Cloud Logging via @google-cloud/logging-bunyan
12
12
  * : new BunyanConsoleFactory(); // 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
  * BREAKING (was `new BunyanFactoryOptions('my-service')` passed to each factory): the service name
package/src/index.js CHANGED
@@ -14,7 +14,7 @@ exports.logLevelToBunyanLevel = exports.LEVEL_TO_BUNYAN = exports.ChunkingRawStr
14
14
  * ? new BunyanGcpFactory() // Cloud Logging via @google-cloud/logging-bunyan
15
15
  * : new BunyanConsoleFactory(); // 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
  * BREAKING (was `new BunyanFactoryOptions('my-service')` passed to each factory): the service name
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/logging/bunyan/src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,qCAAyE;AAAhE,kHAAA,uBAAuB,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AACrD,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,mCAAkE;AAAzD,yGAAA,eAAe,OAAA;AAAE,+GAAA,qBAAqB,OAAA","sourcesContent":["/**\n * @webpieces/bunyan\n *\n * Node-only bunyan {@link LoggerFactory} backends for webpieces. Install one at\n * startup via `LogManager.setFactory(...)`:\n *\n * ```ts\n * import { BunyanGcpFactory, BunyanConsoleFactory } from '@webpieces/bunyan';\n *\n * const loggerFactory = process.env.K_SERVICE\n * ? new BunyanGcpFactory() // Cloud Logging via @google-cloud/logging-bunyan\n * : new BunyanConsoleFactory(); // 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 * BREAKING (was `new BunyanFactoryOptions('my-service')` passed to each factory): the service name\n * moved to `ServiceInfo.setInfo(...)` in @webpieces/core-util, because it is a fact about the\n * SERVICE, not about bunyan — winston needs the same name, and so does `requestIdSource`. Migration:\n * delete the `BunyanFactoryOptions` import, call `ServiceInfo.setInfo(<the same string>, <version>)`\n * before building the factory, and drop the ctor argument. A forgotten call throws at startup.\n *\n * NEW: every line now also carries `version` (the second setInfo arg) — this backend could not stamp\n * a build version before. It is opaque: a git SHA, a semver tag, a CI build number, whatever\n * identifies your build.\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. There is no level knob: bunyan filters at its\n * own default.\n *\n * @packageDocumentation\n */\nexport { BunyanGcpFactory } from './BunyanGcpFactory';\nexport { BunyanConsoleFactory } from './BunyanConsoleFactory';\nexport { BunyanLogger } from './BunyanLogger';\nexport { createGoogleCloudStream, createConsoleStream } from './streams';\nexport { ChunkingRawStream } from './ChunkingRawStream';\nexport { LEVEL_TO_BUNYAN, logLevelToBunyanLevel } from './levels';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/logging/bunyan/src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,qCAAyE;AAAhE,kHAAA,uBAAuB,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AACrD,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,mCAAkE;AAAzD,yGAAA,eAAe,OAAA;AAAE,+GAAA,qBAAqB,OAAA","sourcesContent":["/**\n * @webpieces/bunyan\n *\n * Node-only bunyan {@link LoggerFactory} backends for webpieces. Install one at\n * startup via `LogManager.setFactory(...)`:\n *\n * ```ts\n * import { BunyanGcpFactory, BunyanConsoleFactory } from '@webpieces/bunyan';\n *\n * const loggerFactory = process.env.K_SERVICE\n * ? new BunyanGcpFactory() // Cloud Logging via @google-cloud/logging-bunyan\n * : new BunyanConsoleFactory(); // 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 * BREAKING (was `new BunyanFactoryOptions('my-service')` passed to each factory): the service name\n * moved to `ServiceInfo.setInfo(...)` in @webpieces/core-util, because it is a fact about the\n * SERVICE, not about bunyan — winston needs the same name, and so does `requestIdSource`. Migration:\n * delete the `BunyanFactoryOptions` import, call `ServiceInfo.setInfo(<the same string>, <version>)`\n * before building the factory, and drop the ctor argument. A forgotten call throws at startup.\n *\n * NEW: every line now also carries `version` (the second setInfo arg) — this backend could not stamp\n * a build version before. It is opaque: a git SHA, a semver tag, a CI build number, whatever\n * identifies your build.\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. There is no level knob: bunyan filters at its\n * own default.\n *\n * @packageDocumentation\n */\nexport { BunyanGcpFactory } from './BunyanGcpFactory';\nexport { BunyanConsoleFactory } from './BunyanConsoleFactory';\nexport { BunyanLogger } from './BunyanLogger';\nexport { createGoogleCloudStream, createConsoleStream } from './streams';\nexport { ChunkingRawStream } from './ChunkingRawStream';\nexport { LEVEL_TO_BUNYAN, logLevelToBunyanLevel } from './levels';\n"]}