@contrail/telemetry 1.0.0 → 1.0.1-test-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/CHANGELOG.md +13 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/logger/index.d.ts +3 -0
- package/lib/logger/index.js +20 -0
- package/package.json +25 -4
- package/lib/telemetry.d.ts +0 -5
- package/lib/telemetry.js +0 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@contrail/telemetry` are documented here.
|
|
4
|
+
|
|
5
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.0] - (initial changelog entry)
|
|
11
|
+
|
|
12
|
+
- Initial changelog. Prior releases did not include a changelog.
|
|
13
|
+
See git history for changes predating this entry.
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './logger';
|
package/lib/index.js
CHANGED
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./logger"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
var _a;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.logger = void 0;
|
|
8
|
+
exports.setLogger = setLogger;
|
|
9
|
+
const pino_1 = __importDefault(require("pino"));
|
|
10
|
+
let _logger = (0, pino_1.default)({
|
|
11
|
+
level: (_a = process.env.LOG_LEVEL) !== null && _a !== void 0 ? _a : 'debug',
|
|
12
|
+
});
|
|
13
|
+
exports.logger = new Proxy({}, {
|
|
14
|
+
get(_, prop) {
|
|
15
|
+
return Reflect.get(_logger, prop, _logger);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
function setLogger(replacement) {
|
|
19
|
+
_logger = replacement;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/telemetry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-test-1",
|
|
4
4
|
"description": "Telemetry and monitoring utilities for contrail services",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -8,16 +8,37 @@
|
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
10
10
|
"lint": "tslint -p tsconfig.json",
|
|
11
|
-
"test": "NODE_OPTIONS=--no-node-snapshot jest"
|
|
11
|
+
"test": "LOG_LEVEL=silent NODE_OPTIONS=--no-node-snapshot jest"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [],
|
|
14
14
|
"author": "",
|
|
15
15
|
"license": "ISC",
|
|
16
|
-
"dependencies": {
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"pino": "^10.1.0"
|
|
18
|
+
},
|
|
17
19
|
"devDependencies": {
|
|
20
|
+
"@types/jest": "^29.5.2",
|
|
21
|
+
"@types/node": "^20.0.0",
|
|
22
|
+
"jest": "^29.5.0",
|
|
18
23
|
"prettier": "^1.19.1",
|
|
24
|
+
"ts-jest": "^29.1.1",
|
|
19
25
|
"tslint": "^5.11.0",
|
|
20
26
|
"tslint-config-prettier": "^1.18.0",
|
|
21
|
-
"typescript": "^
|
|
27
|
+
"typescript": "^5.0.0"
|
|
28
|
+
},
|
|
29
|
+
"jest": {
|
|
30
|
+
"moduleFileExtensions": [
|
|
31
|
+
"js",
|
|
32
|
+
"json",
|
|
33
|
+
"ts",
|
|
34
|
+
"node"
|
|
35
|
+
],
|
|
36
|
+
"rootDir": "src",
|
|
37
|
+
"testRegex": ".spec.ts$",
|
|
38
|
+
"transform": {
|
|
39
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
40
|
+
},
|
|
41
|
+
"coverageDirectory": "../coverage",
|
|
42
|
+
"testEnvironment": "node"
|
|
22
43
|
}
|
|
23
44
|
}
|
package/lib/telemetry.d.ts
DELETED