@proteinjs/logger 1.0.5 → 1.0.7

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.6](https://github.com/proteinjs/util/compare/@proteinjs/logger@1.0.5...@proteinjs/logger@1.0.6) (2024-08-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * `Log.error?` is now of type any, since that's a common error type and we shouldn't force errors to be of type `Error` to be logged ([eed6f56](https://github.com/proteinjs/util/commit/eed6f566f530f1dd707edcd086793bfa54d353db))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.0.4](https://github.com/proteinjs/util/compare/@proteinjs/logger@1.0.3...@proteinjs/logger@1.0.4) (2024-08-13)
7
18
 
8
19
 
@@ -17,7 +17,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  require("@proteinjs/reflection");
19
19
  /** Generate Source Graph */
20
- const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"value\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"DefaultLogWriter\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/util/packages/logger/src/DefaultLogWriter.ts\",\"qualifiedName\":\"@proteinjs/logger/DefaultLogWriter\",\"properties\":[],\"methods\":[{\"name\":\"write\",\"returnType\":{\"packageName\":\"\",\"name\":\"void\",\"filePath\":null,\"qualifiedName\":\"/void\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"log\",\"type\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"Log\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/logger/Log\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"/'debug' | 'info' | 'warn' | 'error'\"}],\"edges\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
20
+ const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"value\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"DefaultLogWriter\",\"filePath\":\"/Users/brentbahry/repos/n3xa/packages/proteinjs/packages/util/packages/logger/src/DefaultLogWriter.ts\",\"qualifiedName\":\"@proteinjs/logger/DefaultLogWriter\",\"properties\":[],\"methods\":[{\"name\":\"write\",\"returnType\":{\"packageName\":\"\",\"name\":\"void\",\"filePath\":null,\"qualifiedName\":\"/void\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"log\",\"type\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"Log\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/logger/Log\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"/'debug' | 'info' | 'warn' | 'error'\"}],\"edges\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
21
21
  /** Generate Source Links */
22
22
  const sourceLinks = {};
23
23
  /** Load Source Graph and Links */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,iCAA+B;AAG/B,4BAA4B;AAE5B,MAAM,WAAW,GAAG,g4CAAg4C,CAAC;AAGr5C,4BAA4B;AAG5B,MAAM,WAAW,GAAG,EACnB,CAAC;AAGF,kCAAkC;AAElC,sDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,iCAA+B;AAG/B,4BAA4B;AAE5B,MAAM,WAAW,GAAG,23CAA23C,CAAC;AAGh5C,4BAA4B;AAG5B,MAAM,WAAW,GAAG,EACnB,CAAC;AAGF,kCAAkC;AAElC,sDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
@@ -15,7 +15,7 @@ export type Log = {
15
15
  /** The object being logged */
16
16
  obj?: any;
17
17
  /** The error being logged */
18
- error?: Error;
18
+ error?: any;
19
19
  /** Object formatting options */
20
20
  inspectOptions?: InspectOptions;
21
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultLogWriter.d.ts","sourceRoot":"","sources":["../../src/DefaultLogWriter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAA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AEF;;;;;;;;;KASK;AACL,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;CACvB"}
@@ -13,7 +13,7 @@ type Log = {
13
13
  inspectOptions?: InspectOptions;
14
14
  };
15
15
  type ErrorLog = Log & {
16
- error?: Error;
16
+ error?: any;
17
17
  };
18
18
  export declare class Logger {
19
19
  private name?;
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/Logger.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAuB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3E,KAAK,YAAY,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC;AACzF,KAAK,GAAG,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,cAAc,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAC5E,KAAK,QAAQ,GAAG,GAAG,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAExC,qBAAa,MAAM;IACjB,OAAO,CAAC,IAAI,CAAC,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAmB;gBAEzB,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAE,YAAiB;IAQ5D,OAAO,CAAC,YAAY;IAQpB,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,GAAG;IAWzC,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE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IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,GAAG;IAe1C,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,GAAG;IAe1C,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,QAAQ;CAWxD"}
@@ -5,7 +5,7 @@ import '@proteinjs/reflection';
5
5
 
6
6
  /** Generate Source Graph */
7
7
 
8
- const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"value\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"DefaultLogWriter\",\"filePath\":\"/Users/brentbahry/workspaces/n3xa/packages/proteinjs/packages/util/packages/logger/src/DefaultLogWriter.ts\",\"qualifiedName\":\"@proteinjs/logger/DefaultLogWriter\",\"properties\":[],\"methods\":[{\"name\":\"write\",\"returnType\":{\"packageName\":\"\",\"name\":\"void\",\"filePath\":null,\"qualifiedName\":\"/void\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"log\",\"type\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"Log\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/logger/Log\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"/'debug' | 'info' | 'warn' | 'error'\"}],\"edges\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
8
+ const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"value\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"DefaultLogWriter\",\"filePath\":\"/Users/brentbahry/repos/n3xa/packages/proteinjs/packages/util/packages/logger/src/DefaultLogWriter.ts\",\"qualifiedName\":\"@proteinjs/logger/DefaultLogWriter\",\"properties\":[],\"methods\":[{\"name\":\"write\",\"returnType\":{\"packageName\":\"\",\"name\":\"void\",\"filePath\":null,\"qualifiedName\":\"/void\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"log\",\"type\":{\"packageName\":\"@proteinjs/logger\",\"name\":\"Log\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/logger/Log\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"/'debug' | 'info' | 'warn' | 'error'\"}],\"edges\":[{\"v\":\"@proteinjs/logger/DefaultLogWriter\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"}]}";
9
9
 
10
10
 
11
11
  /** Generate Source Links */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/logger",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "A simple logger",
5
5
  "main": "./dist/generated/index.js",
6
6
  "types": "./dist/generated/index.d.ts",
@@ -23,10 +23,10 @@
23
23
  "watch": "reflection-watch"
24
24
  },
25
25
  "dependencies": {
26
- "@proteinjs/reflection": "1.1.9"
26
+ "@proteinjs/reflection": "1.1.10"
27
27
  },
28
28
  "devDependencies": {
29
- "@proteinjs/reflection-build": "1.0.24",
29
+ "@proteinjs/reflection-build": "1.0.25",
30
30
  "@types/jest": "29.5.5",
31
31
  "@types/node": "20.8.2",
32
32
  "@typescript-eslint/eslint-plugin": "7.8.0",
@@ -17,7 +17,7 @@ export type Log = {
17
17
  /** The object being logged */
18
18
  obj?: any;
19
19
  /** The error being logged */
20
- error?: Error;
20
+ error?: any;
21
21
  /** Object formatting options */
22
22
  inspectOptions?: InspectOptions;
23
23
  };
package/src/Logger.ts CHANGED
@@ -5,7 +5,7 @@ import { DevLogWriter } from './DevLogWriter';
5
5
 
6
6
  type LoggerParams = { name?: string; logLevel?: LogLevel; logWriter?: DefaultLogWriter };
7
7
  type Log = { message?: string; obj?: any; inspectOptions?: InspectOptions };
8
- type ErrorLog = Log & { error?: Error };
8
+ type ErrorLog = Log & { error?: any };
9
9
 
10
10
  export class Logger {
11
11
  private name?: string;