@heritageai/messaging 1.0.16 → 1.0.18
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/dist/utils/logger.d.ts +3 -3
- package/dist/utils/logger.js +13 -3
- package/package.json +2 -1
- package/src/utils/logger.ts +14 -6
- package/tsconfig.json +1 -1
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const logger: {
|
|
2
|
-
info: (msg: string, meta?:
|
|
3
|
-
warn: (msg: string, meta?:
|
|
4
|
-
error: (msg: string, meta?:
|
|
2
|
+
info: (msg: string, meta?: unknown) => void;
|
|
3
|
+
warn: (msg: string, meta?: unknown) => void;
|
|
4
|
+
error: (msg: string, meta?: unknown) => void;
|
|
5
5
|
};
|
package/dist/utils/logger.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.logger = void 0;
|
|
7
|
+
const colors_1 = __importDefault(require("colors"));
|
|
4
8
|
exports.logger = {
|
|
5
9
|
info: (msg, meta) => {
|
|
6
|
-
|
|
10
|
+
meta
|
|
11
|
+
? console.log(colors_1.default.green.underline(`[INFO] ${msg}`), meta)
|
|
12
|
+
: console.log(colors_1.default.green.underline(`[INFO] ${msg}`));
|
|
7
13
|
},
|
|
8
14
|
warn: (msg, meta) => {
|
|
9
|
-
|
|
15
|
+
meta
|
|
16
|
+
? console.warn(colors_1.default.yellow.underline(`[WARN] ${msg}`), meta)
|
|
17
|
+
: console.warn(colors_1.default.yellow.underline(`[WARN] ${msg}`));
|
|
10
18
|
},
|
|
11
19
|
error: (msg, meta) => {
|
|
12
|
-
|
|
20
|
+
meta
|
|
21
|
+
? console.error(colors_1.default.red.underline(`[ERROR] ${msg}`), meta)
|
|
22
|
+
: console.error(colors_1.default.red.underline(`[ERROR] ${msg}`));
|
|
13
23
|
},
|
|
14
24
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "future_platform",
|
|
3
3
|
"name": "@heritageai/messaging",
|
|
4
4
|
"license": "ISC",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.18",
|
|
6
6
|
"description": "",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"prepublishOnly": "npm run build"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"colors": "^1.4.0",
|
|
14
15
|
"node-nats-streaming": "^0.3.2",
|
|
15
16
|
"typescript": "^5.9.0"
|
|
16
17
|
},
|
package/src/utils/logger.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import colors from "colors";
|
|
2
|
+
|
|
1
3
|
export const logger = {
|
|
2
|
-
info: (msg: string, meta?:
|
|
3
|
-
|
|
4
|
+
info: (msg: string, meta?: unknown) => {
|
|
5
|
+
meta
|
|
6
|
+
? console.log(colors.green.underline(`[INFO] ${msg}`), meta)
|
|
7
|
+
: console.log(colors.green.underline(`[INFO] ${msg}`));
|
|
4
8
|
},
|
|
5
|
-
warn: (msg: string, meta?:
|
|
6
|
-
|
|
9
|
+
warn: (msg: string, meta?: unknown) => {
|
|
10
|
+
meta
|
|
11
|
+
? console.warn(colors.yellow.underline(`[WARN] ${msg}`), meta)
|
|
12
|
+
: console.warn(colors.yellow.underline(`[WARN] ${msg}`));
|
|
7
13
|
},
|
|
8
|
-
error: (msg: string, meta?:
|
|
9
|
-
|
|
14
|
+
error: (msg: string, meta?: unknown) => {
|
|
15
|
+
meta
|
|
16
|
+
? console.error(colors.red.underline(`[ERROR] ${msg}`), meta)
|
|
17
|
+
: console.error(colors.red.underline(`[ERROR] ${msg}`));
|
|
10
18
|
},
|
|
11
19
|
};
|
package/tsconfig.json
CHANGED