@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.
@@ -1,5 +1,5 @@
1
1
  export declare const logger: {
2
- info: (msg: string, meta?: any) => void;
3
- warn: (msg: string, meta?: any) => void;
4
- error: (msg: string, meta?: any) => void;
2
+ info: (msg: string, meta?: unknown) => void;
3
+ warn: (msg: string, meta?: unknown) => void;
4
+ error: (msg: string, meta?: unknown) => void;
5
5
  };
@@ -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
- console.log(`[INFO] ${msg}`, meta ?? "");
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
- console.warn(`[WARN] ${msg}`, meta ?? "");
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
- console.error(`[ERROR] ${msg}`, meta ?? "");
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.16",
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
  },
@@ -1,11 +1,19 @@
1
+ import colors from "colors";
2
+
1
3
  export const logger = {
2
- info: (msg: string, meta?: any) => {
3
- console.log(`[INFO] ${msg}`, meta ?? "");
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?: any) => {
6
- console.warn(`[WARN] ${msg}`, meta ?? "");
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?: any) => {
9
- console.error(`[ERROR] ${msg}`, meta ?? "");
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
@@ -105,5 +105,5 @@
105
105
  // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
106
106
  "skipLibCheck": true /* Skip type checking all .d.ts files. */
107
107
  },
108
- "include": ["src/**/*"]
108
+ "include": ["src/**/*.ts"]
109
109
  }