{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Logging/issues/366","repository_url":"https://api.github.com/repos/aspnet/Logging","labels_url":"https://api.github.com/repos/aspnet/Logging/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Logging/issues/366/comments","events_url":"https://api.github.com/repos/aspnet/Logging/issues/366/events","html_url":"https://github.com/aspnet/Logging/issues/366","id":135090932,"number":366,"title":"Should BeginScopeImpl be a generic method","user":{"login":"davidfowl","id":95136,"avatar_url":"https://avatars.githubusercontent.com/u/95136?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfowl","html_url":"https://github.com/davidfowl","followers_url":"https://api.github.com/users/davidfowl/followers","following_url":"https://api.github.com/users/davidfowl/following{/other_user}","gists_url":"https://api.github.com/users/davidfowl/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfowl/subscriptions","organizations_url":"https://api.github.com/users/davidfowl/orgs","repos_url":"https://api.github.com/users/davidfowl/repos","events_url":"https://api.github.com/users/davidfowl/events{/privacy}","received_events_url":"https://api.github.com/users/davidfowl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Logging/labels/Perf","name":"Perf","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/aspnet/Logging/milestones/16","html_url":"https://github.com/aspnet/Logging/milestones/1.0.0-rc2","labels_url":"https://api.github.com/repos/aspnet/Logging/milestones/16/labels","id":1377955,"number":16,"title":"1.0.0-rc2","description":null,"creator":{"login":"muratg","id":1808428,"avatar_url":"https://avatars.githubusercontent.com/u/1808428?v=3","gravatar_id":"","url":"https://api.github.com/users/muratg","html_url":"https://github.com/muratg","followers_url":"https://api.github.com/users/muratg/followers","following_url":"https://api.github.com/users/muratg/following{/other_user}","gists_url":"https://api.github.com/users/muratg/gists{/gist_id}","starred_url":"https://api.github.com/users/muratg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muratg/subscriptions","organizations_url":"https://api.github.com/users/muratg/orgs","repos_url":"https://api.github.com/users/muratg/repos","events_url":"https://api.github.com/users/muratg/events{/privacy}","received_events_url":"https://api.github.com/users/muratg/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":25,"state":"open","created_at":"2015-10-26T19:36:24Z","updated_at":"2016-02-21T22:49:26Z","due_on":null,"closed_at":null},"comments":16,"created_at":"2016-02-20T16:10:08Z","updated_at":"2016-03-03T00:37:47Z","closed_at":null,"body":"For all the same reasons that `Log<T>`  is generic https://github.com/aspnet/Logging/blob/dev/src/Microsoft.Extensions.Logging.Abstractions/ILogger.cs#L36.\r\n\r\n/cc @lodejard @rynowak @Eilon "},"comment":{"url":"https://api.github.com/repos/aspnet/Logging/issues/comments/191509583","html_url":"https://github.com/aspnet/Logging/issues/366#issuecomment-191509583","issue_url":"https://api.github.com/repos/aspnet/Logging/issues/366","id":191509583,"user":{"login":"lodejard","id":1693989,"avatar_url":"https://avatars.githubusercontent.com/u/1693989?v=3","gravatar_id":"","url":"https://api.github.com/users/lodejard","html_url":"https://github.com/lodejard","followers_url":"https://api.github.com/users/lodejard/followers","following_url":"https://api.github.com/users/lodejard/following{/other_user}","gists_url":"https://api.github.com/users/lodejard/gists{/gist_id}","starred_url":"https://api.github.com/users/lodejard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lodejard/subscriptions","organizations_url":"https://api.github.com/users/lodejard/orgs","repos_url":"https://api.github.com/users/lodejard/repos","events_url":"https://api.github.com/users/lodejard/events{/privacy}","received_events_url":"https://api.github.com/users/lodejard/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T00:37:47Z","updated_at":"2016-03-03T00:37:47Z","body":"> While you can easily create a valuetype shim that's mostly no cost. You can't use it to defer expensive execution since its a valuetype its not shared and if you had multiple loggers its deferred cost would now be incurred multiple times. \r\n\r\nYeah, but if there's a `T1`/`T2` pair with `Func<T1,T2>` then each logger provider will call the func, so it's also incurred multiple times. Unless the Func is also stateful and returns the same T2 each time, in which case it means there is a closure, so there's an allocation for the closure per scope even if the callback isn't called..."}}