Reputation: 1141
I'm developing a small open source library which is also available on Nuget with no dependencies. Now I want to use NLog just for debugging purposes in "Debug Mode" but I don't want it to be a dependency when I release new versions on Nuget. What is the best way to do it if this is a reasonable approach at all.
thanks
Upvotes: 1
Views: 362
Reputation: 36770
You can use
Logger.ConditionalTrace("entering method {0}", methodname);
etc. Those will be removed in a non-debug build. . See NLog 4.0 release post. Then you can safely remove the dependency in your NuGet package.
Upvotes: 1