Skip to content
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

fix: re-work logging config #278

Merged
merged 1 commit into from
Oct 6, 2022
Merged

fix: re-work logging config #278

merged 1 commit into from
Oct 6, 2022

Conversation

cprice404
Copy link
Contributor

This commit does some re-working on how we expose and curry the
logging config (ILoggerFactory).

The motivation for this PR is that many (most?) Middlewares and
Retry Strategies will need access to the logging config, and it
is very cumbersome to try to pass it in as a constructor arg
to every single one of those. Especially in the pre-built configs,
which currently do not even have direct access to the ILoggerFactory.

To address this we move the ILoggerFactory to be a first-class
member of the IConfiguration itself. We also alter the constructors
for the Configuration class such that it will loop over all of the
Middlewares and the RetryStrategy and set the ILoggerFactory on them
if they do not already have one.

This ensures that customers only ever need to explictly pass the
ILoggerFactory to at most one of the constructors (the Configuration),
but we will have access to it from all of the Middlewares and other
objects that are encapsulated within the Configuration.

This commit does some re-working on how we expose and curry the
logging config (ILoggerFactory).

The motivation for this PR is that many (most?) Middlewares and
Retry Strategies will need access to the logging config, and it
is very cumbersome to try to pass it in as a constructor arg
to every single one of those.  Especially in the pre-built configs,
which currently do not even have direct access to the ILoggerFactory.

To address this we move the ILoggerFactory to be a first-class
member of the IConfiguration itself.  We also alter the constructors
for the Configuration class such that it will loop over all of the
Middlewares and the RetryStrategy and set the ILoggerFactory on them
if they do not already have one.

This ensures that customers only ever need to explictly pass the
ILoggerFactory to at most one of the constructors (the Configuration),
but we will have access to it from all of the Middlewares and other
objects that are encapsulated within the Configuration.
Copy link
Contributor

@malandis malandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cprice404 cprice404 merged commit d51738b into main Oct 6, 2022
@cprice404 cprice404 deleted the rework-logging-config branch October 6, 2022 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants