deepkit / deepkit-framework

A new full-featured and high-performance TypeScript framework
https://deepkit.io/
MIT License
3.23k stars 123 forks source link

Feature request: DX: Logger: Scopped logger autoinjection #602

Open alpharder opened 4 months ago

alpharder commented 4 months ago

.NET-alike generic logger autoinjection:

export class SessionsService {
  constructor(
    protected readonly logger: Logger<SessionsService> // results in logger.scoped('SessionsService') autoinjection
  )
}
fergusean commented 2 months ago

I'm not familiar with .NET's logger, but based on your example, I believe this is what ScopedLogger provides (https://github.com/deepkit/deepkit-framework/pull/483)