nestjs-log-decorator 1.0.0 → 1.1.0
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.cjs +16 -6
- package/dist/index.d.cts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -82,12 +82,22 @@ var LogWrapper = class {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
error(error) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
try {
|
|
86
|
+
const pretifiedError = prettifyAxiosError(error);
|
|
87
|
+
this.logger.error({
|
|
88
|
+
method: this.method,
|
|
89
|
+
state: "error",
|
|
90
|
+
args: this.args,
|
|
91
|
+
error: pretifiedError
|
|
92
|
+
});
|
|
93
|
+
} catch {
|
|
94
|
+
this.logger.error({
|
|
95
|
+
method: this.method,
|
|
96
|
+
state: "error",
|
|
97
|
+
args: this.args,
|
|
98
|
+
error
|
|
99
|
+
});
|
|
100
|
+
}
|
|
91
101
|
}
|
|
92
102
|
};
|
|
93
103
|
const isLoggable = (instance) => {
|
package/dist/index.d.cts
CHANGED
|
@@ -250,4 +250,4 @@ declare const Log: <TArgs extends unknown[]>(options?: LogOptions<TArgs>) => Log
|
|
|
250
250
|
*/
|
|
251
251
|
declare const NoLog: () => (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
252
252
|
//#endregion
|
|
253
|
-
export { Log, type LogOptions, type Loggable, NoLog, isLoggable };
|
|
253
|
+
export { Log, type LogArgsFormatter, type LogOptions, type Loggable, NoLog, isLoggable };
|
package/package.json
CHANGED