@opentelemetry/winston-transport 0.2.0 → 0.4.0

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/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [2022] OpenTelemetry Authors
189
+ Copyright [yyyy] [name of copyright owner]
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -55,9 +55,9 @@ Winston `3.x`
55
55
 
56
56
  ## Useful links
57
57
 
58
- * For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
59
- * For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
60
- * For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
58
+ - For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
59
+ - For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
60
+ - For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
61
61
 
62
62
  ## License
63
63
 
@@ -1,7 +1,7 @@
1
- import * as Transport from 'winston-transport';
2
- export declare class OpenTelemetryTransportV3 extends Transport {
1
+ import TransportStream = require('winston-transport');
2
+ export declare class OpenTelemetryTransportV3 extends TransportStream {
3
3
  private _logger;
4
- constructor(options?: Transport.TransportStreamOptions);
5
- log(info: any, next: () => void): void;
4
+ constructor(options?: TransportStream.TransportStreamOptions);
5
+ log(info: any, callback: () => void): void;
6
6
  }
7
7
  //# sourceMappingURL=OpenTelemetryTransportV3.d.ts.map
@@ -17,26 +17,24 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.OpenTelemetryTransportV3 = void 0;
19
19
  const api_logs_1 = require("@opentelemetry/api-logs");
20
- const Transport = require("winston-transport");
20
+ const TransportStream = require("winston-transport");
21
21
  const version_1 = require("./version");
22
22
  const utils_1 = require("./utils");
23
- class OpenTelemetryTransportV3 extends Transport {
23
+ class OpenTelemetryTransportV3 extends TransportStream {
24
24
  constructor(options) {
25
25
  super(options);
26
- this._logger = api_logs_1.logs.getLogger('@opentelemetry/winston-transport', version_1.VERSION);
26
+ this._logger = api_logs_1.logs.getLogger(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION);
27
27
  }
28
- log(info, next) {
28
+ log(info, callback) {
29
29
  try {
30
30
  (0, utils_1.emitLogRecord)(info, this._logger);
31
31
  }
32
32
  catch (error) {
33
33
  this.emit('warn', error);
34
34
  }
35
- setImmediate(() => {
36
- this.emit('logged', info);
37
- });
38
- if (next) {
39
- setImmediate(next);
35
+ this.emit('logged', info);
36
+ if (callback) {
37
+ callback();
40
38
  }
41
39
  }
42
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OpenTelemetryTransportV3.js","sourceRoot":"","sources":["../../src/OpenTelemetryTransportV3.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sDAAuD;AACvD,+CAA+C;AAC/C,uCAAoC;AACpC,mCAAwC;AAExC,MAAa,wBAAyB,SAAQ,SAAS;IAGrD,YAAY,OAA0C;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,eAAI,CAAC,SAAS,CAAC,kCAAkC,EAAE,iBAAO,CAAC,CAAC;IAC7E,CAAC;IAEe,GAAG,CAAC,IAAS,EAAE,IAAgB;QAC7C,IAAI;YACF,IAAA,qBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACnC;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SAC1B;QACD,YAAY,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,IAAI,IAAI,EAAE;YACR,YAAY,CAAC,IAAI,CAAC,CAAC;SACpB;IACH,CAAC;CACF;AArBD,4DAqBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger, logs } from '@opentelemetry/api-logs';\nimport * as Transport from 'winston-transport';\nimport { VERSION } from './version';\nimport { emitLogRecord } from './utils';\n\nexport class OpenTelemetryTransportV3 extends Transport {\n private _logger: Logger;\n\n constructor(options?: Transport.TransportStreamOptions) {\n super(options);\n this._logger = logs.getLogger('@opentelemetry/winston-transport', VERSION);\n }\n\n public override log(info: any, next: () => void) {\n try {\n emitLogRecord(info, this._logger);\n } catch (error) {\n this.emit('warn', error);\n }\n setImmediate(() => {\n this.emit('logged', info);\n });\n if (next) {\n setImmediate(next);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"OpenTelemetryTransportV3.js","sourceRoot":"","sources":["../../src/OpenTelemetryTransportV3.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sDAAuD;AACvD,qDAAsD;AACtD,uCAA0D;AAC1D,mCAAwC;AAExC,MAAa,wBAAyB,SAAQ,eAAe;IAG3D,YAAY,OAAgD;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,eAAI,CAAC,SAAS,CAAC,sBAAY,EAAE,yBAAe,CAAC,CAAC;IAC/D,CAAC;IAEe,GAAG,CAAC,IAAS,EAAE,QAAoB;QACjD,IAAI;YACF,IAAA,qBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACnC;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SAC1B;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC1B,IAAI,QAAQ,EAAE;YACZ,QAAQ,EAAE,CAAC;SACZ;IACH,CAAC;CACF;AAnBD,4DAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger, logs } from '@opentelemetry/api-logs';\nimport TransportStream = require('winston-transport');\nimport { PACKAGE_NAME, PACKAGE_VERSION } from './version';\nimport { emitLogRecord } from './utils';\n\nexport class OpenTelemetryTransportV3 extends TransportStream {\n private _logger: Logger;\n\n constructor(options?: TransportStream.TransportStreamOptions) {\n super(options);\n this._logger = logs.getLogger(PACKAGE_NAME, PACKAGE_VERSION);\n }\n\n public override log(info: any, callback: () => void) {\n try {\n emitLogRecord(info, this._logger);\n } catch (error) {\n this.emit('warn', error);\n }\n this.emit('logged', info);\n if (callback) {\n callback();\n }\n }\n}\n"]}
@@ -1,2 +1,3 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const PACKAGE_VERSION = "0.4.0";
2
+ export declare const PACKAGE_NAME = "@opentelemetry/winston-transport";
2
3
  //# sourceMappingURL=version.d.ts.map
@@ -15,7 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.VERSION = void 0;
18
+ exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.VERSION = '0.2.0';
20
+ exports.PACKAGE_VERSION = '0.4.0';
21
+ exports.PACKAGE_NAME = '@opentelemetry/winston-transport';
21
22
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.2.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,OAAO,CAAC;AAC1B,QAAA,YAAY,GAAG,kCAAkC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.4.0';\nexport const PACKAGE_NAME = '@opentelemetry/winston-transport';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/winston-transport",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "OpenTelemetry Transport for winston",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -50,9 +50,9 @@
50
50
  "typescript": "4.4.4"
51
51
  },
52
52
  "dependencies": {
53
- "@opentelemetry/api-logs": "^0.50.0",
53
+ "@opentelemetry/api-logs": "^0.52.0",
54
54
  "winston-transport": "4.*"
55
55
  },
56
56
  "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/winston-transport#readme",
57
- "gitHead": "17a0bc1da3baa472ba9b867eee3c60730cc130fb"
57
+ "gitHead": "0af1b70f7c3c9763c85ac51fa5e334c1e1512020"
58
58
  }