net-commons/common-logging — pull request #30 by Daniel-Svensson (2013-04-20 16:13:29+00:00)
Title: Portable implementation of Common.Logging

These changes fixes https://github.com/net-commons/common-logging/issues/24 and make common.logging into a portable library with support for net40+sl4+win8+wp7 while still (mainly) staying binary compatible with older releases.

The changes are based on https://github.com/net-commons/common-logging/pull/21 so many thanks to @ioancrisan which started the implementation and gave feedback on the model with separate assemblies.

Major changes
------

_Common.Logging is split into two assemblies_

Refer to https://github.com/net-commons/common-logging/pull/21 for some discussion about this

* Common.Logging.Core:
Which is the portable part, this is most things in Common.Logging except the TraceLogger and ConsoleLogger

* Common.Logging:
This is intended to be the platform dependent part of Common.Logging
For .Net it includes the .Net System.Diagnostics Logging

_New logger_

Since the Console is not portable a DebugLogger has been added to Common.Logging.Core

_ AbstractSimpleLoggerFactoryAdapter _

The *new* *Common.Logging.Configuration.NameValueCollection* is used instead of the one in System.Collection.Specializations since the later is not portable. It should be enough to change your using statements if you are implementing your own LoggerFactoryAdapter

Answers to probable questions
-----------

_What about .Net 2.0-3.5:_

There are .net 2.0 versions of Common.Logging and Common.Logging.Core

_What do you mean by mostly binary compilant?_

Most users should just be able to swap out their common.logging.dll with the new common.logging.dll *and* common.logging.core.dll , there there are some cases in which this is not possible and a new compilation is required.

* I did not keep the constructors taking in NameValueCollection for the EntLib libraries (but this can be added just as it is done for nlog and log4net.
* There are TypeForwarders for most classes which you are expected to use in Common.Logging, but if you are an "advanced" user implementing your own LoggingFactoryAdapter deriving from AbstractLoggingFactoryAdapter then you will have to recompile your code.