@opentelemetry/winston-transport 0.14.0 → 0.14.1
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/build/src/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Logger } from '@opentelemetry/api-logs';
|
|
2
|
-
export declare function emitLogRecord(record: Record<string, any>, logger: Logger): void;
|
|
2
|
+
export declare function emitLogRecord(record: Record<string | symbol, any>, logger: Logger): void;
|
|
3
3
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/src/utils.js
CHANGED
|
@@ -54,14 +54,18 @@ function getSeverityNumber(level) {
|
|
|
54
54
|
function emitLogRecord(record, logger) {
|
|
55
55
|
const { message, level, ...splat } = record;
|
|
56
56
|
const attributes = {};
|
|
57
|
+
// Ensures the log level is read from a symbol property, avoiding any
|
|
58
|
+
// accidental inclusion of ANSI color codes that may be present in the string
|
|
59
|
+
// property.
|
|
60
|
+
const levelSym = record[Symbol.for('level')];
|
|
57
61
|
for (const key in splat) {
|
|
58
62
|
if (Object.prototype.hasOwnProperty.call(splat, key)) {
|
|
59
63
|
attributes[key] = splat[key];
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
const logRecord = {
|
|
63
|
-
severityNumber: getSeverityNumber(
|
|
64
|
-
severityText:
|
|
67
|
+
severityNumber: getSeverityNumber(levelSym),
|
|
68
|
+
severityText: levelSym,
|
|
65
69
|
body: message,
|
|
66
70
|
attributes: attributes,
|
|
67
71
|
};
|
package/build/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sDAKiC;AAEjC,MAAM,SAAS,GAA2B;IACxC,KAAK,EAAE,yBAAc,CAAC,KAAK;IAC3B,IAAI,EAAE,yBAAc,CAAC,IAAI;IACzB,IAAI,EAAE,yBAAc,CAA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,CAC3B,MAAoC,EACpC,MAAc;IAEd,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;IAC5C,MAAM,UAAU,GAAkB,EAAE,CAAC;IACrC,qEAAqE;IACrE,6EAA6E;IAC7E,YAAY;IACZ,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;QACvB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;YACpD,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SAC9B;KACF;IACD,MAAM,SAAS,GAAc;QAC3B,cAAc,EAAE,iBAAiB,CAAC,QAAQ,CAAC;QAC3C,YAAY,EAAE,QAAQ;QACtB,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,UAAU;KACvB,CAAC;IACF,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACzB,CAAC;AAtBD,sCAsBC","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 {\n LogAttributes,\n LogRecord,\n Logger,\n SeverityNumber,\n} from '@opentelemetry/api-logs';\n\nconst npmLevels: Record<string, number> = {\n error: SeverityNumber.ERROR,\n warn: SeverityNumber.WARN,\n info: SeverityNumber.INFO,\n http: SeverityNumber.DEBUG3,\n verbose: SeverityNumber.DEBUG2,\n debug: SeverityNumber.DEBUG,\n silly: SeverityNumber.TRACE,\n};\n\nconst sysLoglevels: Record<string, number> = {\n emerg: SeverityNumber.FATAL3,\n alert: SeverityNumber.FATAL2,\n crit: SeverityNumber.FATAL,\n error: SeverityNumber.ERROR,\n warning: SeverityNumber.WARN,\n notice: SeverityNumber.INFO2,\n info: SeverityNumber.INFO,\n debug: SeverityNumber.DEBUG,\n};\n\nconst cliLevels: Record<string, number> = {\n error: SeverityNumber.ERROR,\n warn: SeverityNumber.WARN,\n help: SeverityNumber.INFO3,\n data: SeverityNumber.INFO2,\n info: SeverityNumber.INFO,\n debug: SeverityNumber.DEBUG,\n prompt: SeverityNumber.TRACE4,\n verbose: SeverityNumber.TRACE3,\n input: SeverityNumber.TRACE2,\n silly: SeverityNumber.TRACE,\n};\n\nfunction getSeverityNumber(level: string): SeverityNumber | undefined {\n return npmLevels[level] ?? sysLoglevels[level] ?? cliLevels[level];\n}\n\nexport function emitLogRecord(\n record: Record<string | symbol, any>,\n logger: Logger\n): void {\n const { message, level, ...splat } = record;\n const attributes: LogAttributes = {};\n // Ensures the log level is read from a symbol property, avoiding any\n // accidental inclusion of ANSI color codes that may be present in the string\n // property.\n const levelSym = record[Symbol.for('level')];\n for (const key in splat) {\n if (Object.prototype.hasOwnProperty.call(splat, key)) {\n attributes[key] = splat[key];\n }\n }\n const logRecord: LogRecord = {\n severityNumber: getSeverityNumber(levelSym),\n severityText: levelSym,\n body: message,\n attributes: attributes,\n };\n logger.emit(logRecord);\n}\n"]}
|
package/build/src/version.d.ts
CHANGED
package/build/src/version.js
CHANGED
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
|
|
19
19
|
// this is autogenerated file, see scripts/version-update.js
|
|
20
|
-
exports.PACKAGE_VERSION = '0.14.
|
|
20
|
+
exports.PACKAGE_VERSION = '0.14.1';
|
|
21
21
|
exports.PACKAGE_NAME = '@opentelemetry/winston-transport';
|
|
22
22
|
//# sourceMappingURL=version.js.map
|
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,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.14.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,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.14.1';\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.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "OpenTelemetry Transport for winston",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"types": "build/src/index.d.ts",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"directory": "packages/winston-transport"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"test": "nyc mocha 'test/**/*.test.ts'",
|
|
14
|
-
"tdd": "npm run test -- --watch-extensions ts --watch",
|
|
15
13
|
"clean": "rimraf build/*",
|
|
14
|
+
"compile": "tsc -p .",
|
|
15
|
+
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/winston-transport",
|
|
16
16
|
"lint": "eslint . --ext .ts",
|
|
17
17
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
18
18
|
"prepublishOnly": "npm run compile",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"tdd": "npm run test -- --watch-extensions ts --watch",
|
|
20
|
+
"test": "nyc mocha 'test/**/*.test.ts'",
|
|
21
|
+
"version:update": "node ../../scripts/version-update.js"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"transport",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"winston-transport": "4.*"
|
|
56
56
|
},
|
|
57
57
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/winston-transport#readme",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "aca1437f8ce0315b3941460063311bb8332020b8"
|
|
59
59
|
}
|