-
-
Notifications
You must be signed in to change notification settings - Fork 7
Could we make it optional to provide a ILoggerFactory and resolve it? #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I would rather have it as |
how would that work? My case is that the container already have a registration for ILoggerFactory. Should i then add one extra registration for Feels like i am missing something. |
Resolving ILoggerFactroy is slow |
It could be something like this: [InjectionConstructor]
public LoggingExtension()
{
_loggerFactory = new Lazy<ILoggerFactory>(() => new LoggerFactory());
}
... Also, user should be able to provide his own instance of ILoggerFactory |
I dont understand how your example will work with the given example here. The container knows about ILoggerFactory and it cannot be created at the time of adding the logging extension. |
My usecase is that the ILoggerFactory is build as part of startup and I want to lazy create it until the first ILogger is needed.
I modified the extension
What do you think, should we consider resolving it instead of giving it when constructing the extension?
The text was updated successfully, but these errors were encountered: