开发者

Using dependency injection with NLog

开发者 https://www.devze.com 2022-12-13 09:37 出处:网络
I\'m using NLog as my logger, however I cant seem to find an Ilogger interface in NLog namespaces unlike log4net\'s Ilogger interfac开发者_JAVA技巧e, do I have to create my own wrapper?You need to cre

I'm using NLog as my logger, however I cant seem to find an Ilogger interface in NLog namespaces unlike log4net's Ilogger interfac开发者_JAVA技巧e, do I have to create my own wrapper?


You need to create a wrapping interface only if you expect to use a different logging technology in the future or if you need to mock the logger for unit testing; if not, the dependency injector will probably let you register concrete instances of the logging class you are using.

0

精彩评论

暂无评论...
验证码 换一张
取 消