@webpieces/bunyan 0.4.412 → 0.4.414

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpieces/bunyan",
3
- "version": "0.4.412",
3
+ "version": "0.4.414",
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.412",
27
- "@webpieces/core-context": "0.4.412",
26
+ "@webpieces/core-util": "0.4.414",
27
+ "@webpieces/core-context": "0.4.414",
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
@@ -5,14 +5,13 @@
5
5
  * startup via `LogManager.setFactory(...)`:
6
6
  *
7
7
  * ```ts
8
- * import { ServiceInfo } from '@webpieces/core-util';
9
8
  * import { BunyanGcpFactory, BunyanConsoleFactory } from '@webpieces/bunyan';
10
9
  *
11
- * ServiceInfo.setInfo('my-service', '2.1.0'); // FIRST — the factories read it in their constructor
12
10
  * const loggerFactory = process.env.K_SERVICE
13
11
  * ? new BunyanGcpFactory() // Cloud Logging via @google-cloud/logging-bunyan
14
12
  * : new BunyanConsoleFactory(); // local → pretty console
15
- * // hand to setupRuntime(new RuntimeSetupOptions(loggerFactory, ...))
13
+ * // setupRuntime identifies the service (name+version are REQUIRED inputs) and installs the backend:
14
+ * // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', loggerFactory, ...))
16
15
  * ```
17
16
  *
18
17
  * BREAKING (was `new BunyanFactoryOptions('my-service')` passed to each factory): the service name
package/src/index.js CHANGED
@@ -8,14 +8,13 @@ exports.logLevelToBunyanLevel = exports.LEVEL_TO_BUNYAN = exports.ChunkingRawStr
8
8
  * startup via `LogManager.setFactory(...)`:
9
9
  *
10
10
  * ```ts
11
- * import { ServiceInfo } from '@webpieces/core-util';
12
11
  * import { BunyanGcpFactory, BunyanConsoleFactory } from '@webpieces/bunyan';
13
12
  *
14
- * ServiceInfo.setInfo('my-service', '2.1.0'); // FIRST — the factories read it in their constructor
15
13
  * const loggerFactory = process.env.K_SERVICE
16
14
  * ? new BunyanGcpFactory() // Cloud Logging via @google-cloud/logging-bunyan
17
15
  * : new BunyanConsoleFactory(); // local → pretty console
18
- * // hand to setupRuntime(new RuntimeSetupOptions(loggerFactory, ...))
16
+ * // setupRuntime identifies the service (name+version are REQUIRED inputs) and installs the backend:
17
+ * // setupRuntime(new RuntimeSetupOptions('my-service', '2.1.0', loggerFactory, ...))
19
18
  * ```
20
19
  *
21
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;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 { ServiceInfo } from '@webpieces/core-util';\n * import { BunyanGcpFactory, BunyanConsoleFactory } from '@webpieces/bunyan';\n *\n * ServiceInfo.setInfo('my-service', '2.1.0'); // FIRST — the factories read it in their constructor\n * const loggerFactory = process.env.K_SERVICE\n * ? new BunyanGcpFactory() // Cloud Logging via @google-cloud/logging-bunyan\n * : new BunyanConsoleFactory(); // local → pretty console\n * // hand to setupRuntime(new RuntimeSetupOptions(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', 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"]}