Skip to content

Conversation

skomis-mm
Copy link
Contributor

@skomis-mm skomis-mm commented May 13, 2018

What issue does this PR address?
Logger references to its configuration instance via Dispose closure that captures it.

Does this PR introduce a breaking change?
No.

Please check if the PR fulfills these requirements

  • The commit follows our guidelines
  • Unit Tests for the changes have been added (for bug fixes / features)

Other information:
After checking implications of introducing new state (.WriteTo) for LoggerConfiguration in the neighboring pr found that current CreateLogger() captures LoggerConfiguration instances.

@@ -185,9 +179,18 @@ public Logger CreateLogger()
overrideMap = new LevelOverrideMap(_overrides, _minimumLevel, _levelSwitch);
}

var disposableSinks = _logEventSinks.Concat(_auditSinks).OfType<IDisposable>().ToList();
Copy link
Member

Choose a reason for hiding this comment

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

ToArray might be microscopically better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no reason to not making it microscopically better :) Done.

@nblumhardt nblumhardt merged commit d0ea61f into serilog:dev May 13, 2018
@nblumhardt
Copy link
Member

👍 good catch.

@nblumhardt nblumhardt mentioned this pull request May 17, 2018
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