Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TransientInjectorTarget & ScopedLogger #483

Merged
merged 4 commits into from
Oct 1, 2023

Conversation

timvandam
Copy link
Contributor

@timvandam timvandam commented Sep 20, 2023

Summary of changes

Adds a TransientInjectorTarget class that can be injected into transient providers/useFactory functions when the provider is injected into other providers. This allows for the creation of context aware classes, such as loggers scoped to the class they are used in.

Also adds a ScopedLogger to @deepkit/logger and @deepkit/framework's FrameworkModule that uses TransientInjectorTarget to create loggers scoped to the provider token name

Relinquishment of Rights

Please mark following checkbox to confirm that you relinquish all rights of your changes:

  • I waive and relinquish all rights regarding this changes (including code, text, and images) to Deepkit UG (limited), Germany. This changes (including code, text, and images) are under MIT license without name attribution, copyright notice, and permission notice requirement.

@timvandam timvandam changed the title feature(injector): TransientInjectorTarget injectable TransientInjectorTarget & ScopedLogger Sep 21, 2023
@marcj marcj merged commit e90f02c into deepkit:master Oct 1, 2023
4 of 5 checks passed
@marcj
Copy link
Member

marcj commented Oct 1, 2023

Great stuff, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants