mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
refactor(server): auto print full stack on logger.error (#10161)
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
import { WinstonLogger } from 'nest-winston';
|
||||
|
||||
import { AFFiNELogger as RawAFFiNELogger } from '../../../base/logger';
|
||||
|
||||
export class AFFiNELogger extends WinstonLogger {
|
||||
override error(
|
||||
message: any,
|
||||
trace?: Error | string | unknown,
|
||||
stackOrError?: Error | string | unknown,
|
||||
context?: string
|
||||
) {
|
||||
if (trace && trace instanceof Error) {
|
||||
super.error(message, trace.stack, context);
|
||||
} else if (typeof trace === 'string' || trace === undefined) {
|
||||
super.error(message, trace, context);
|
||||
} else {
|
||||
super.error(message, undefined, context);
|
||||
}
|
||||
RawAFFiNELogger.prototype.error.call(this, message, stackOrError, context);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user