patterns-group / code-patterns

Code Patterns: lots of reusable goodies for your .NET project
tribesoftware.org/code-patterns/
BSD 2-Clause "Simplified" License
9 stars 9 forks source link

New types for automatic logging via IoC: Autofac, Ninject #74

Open TheTribe opened 11 years ago

TheTribe commented 11 years ago

Need a new type, LoggingInterceptor, that implements IInterceptor from Castle.Core; should rely on ILog to log appropriate events. Need integration with IoC along with this

== EDIT: See comments for issue details ==

TheTribe commented 11 years ago

Should also consider the addition of an automatic-inclusion path for IoC. I think Autofac's IRegistrationSource is the way to go there; not sure about the other flavors

TheTribe commented 11 years ago

Found the solution for Castle: use an IModelnterceptorsSelector. This will allow the exact same functionality as Autofac's IRegistrationSource.

jbatte47 commented 11 years ago

Wow, I've lost my mind. This is already done; I could've sworn it was still outstanding but nope, LoggingInterceptor is in and it's got good test coverage. Its specifications still need to be expanded to include all IoC flavors and the question of IModelInterceptorsSelector and whatever Ninject prescribes is still open, so this ticket is still valid, but it should've been titled: "New types: AutoLoggingRegistrationSource, AutoLoggingInterceptorsSelector, and AutoLoggingWhateverNinjectUses"