trying to fix tests

This commit is contained in:
Bojan Kucera 2025-06-07 11:44:45 -04:00
parent 6b4d4ea29f
commit db66687f48
3 changed files with 159 additions and 64 deletions

View file

@ -176,12 +176,14 @@ export class Logger {
message: String(error)
};
}
/**
* Create child logger with additional context
*/
child(context: LogContext): Logger {
return new Logger((this.pino.bindings() as any).service, { ...this.context, ...context });
const childLogger = new Logger((this.pino.bindings() as any).service, { ...this.context, ...context });
// Use the pino child logger to properly propagate context
childLogger.pino = this.pino.child(context);
return childLogger;
}
}