modality-kit 0.0.3 → 0.0.5

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/index.js CHANGED
@@ -113,6 +113,9 @@ class ModalityLogger {
113
113
  if (timestamp) {
114
114
  prefix += ` [${timestamp}]`;
115
115
  }
116
+ if (this.options.name) {
117
+ prefix += ` [${this.options.name}]`;
118
+ }
116
119
  if (categroy) {
117
120
  prefix += ` [${categroy}]`;
118
121
  }
@@ -154,10 +157,10 @@ class ModalityLogger {
154
157
  }
155
158
  error(message, error) {
156
159
  const data = { message };
157
- if (error) {
160
+ if (error instanceof Error) {
158
161
  data.error = {
159
- message: error.message,
160
- stack: error.stack
162
+ message: error?.message,
163
+ stack: error?.stack
161
164
  };
162
165
  }
163
166
  this.log("error", data);
@@ -21,7 +21,7 @@ export declare class ModalityLogger {
21
21
  debug(message: string, error?: Error): void;
22
22
  info(message: string, data?: any): void;
23
23
  warn(message: string, resolution: string): void;
24
- error(message: string, error?: Error): void;
24
+ error(message: string, error?: Error | unknown): void;
25
25
  success(message: string, data?: any): void;
26
26
  }
27
27
  export declare const loggerInstance: typeof ModalityLogger.getInstance;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.3",
2
+ "version": "0.0.5",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",