mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
18 lines
475 B
TypeScript
18 lines
475 B
TypeScript
import { WinstonLogger } from 'nest-winston';
|
|
|
|
export class AFFiNELogger extends WinstonLogger {
|
|
override error(
|
|
message: any,
|
|
trace?: 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);
|
|
}
|
|
}
|
|
}
|