AddUp.AnyLog 0.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package AddUp.AnyLog --version 0.2.1
NuGet\Install-Package AddUp.AnyLog -Version 0.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AddUp.AnyLog" Version="0.2.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AddUp.AnyLog --version 0.2.1
#r "nuget: AddUp.AnyLog, 0.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AddUp.AnyLog as a Cake Addin
#addin nuget:?package=AddUp.AnyLog&version=0.2.1

// Install AddUp.AnyLog as a Cake Tool
#tool nuget:?package=AddUp.AnyLog&version=0.2.1

AddUp.AnyLog

Build Quality Gate Status NuGet

A dependency-free code-only logging abstraction.

About

We currently make heavy use of Common.Logging in our internal shared libraries. Howvever, this poses several problems. I won't bother explaining why I made this lib as others have done before and will simply quote LibLog's author:

LibLog is designed specifically and primarily for library developers that want to provide logging capabilities.

This has been typically achieved in one of three ways:

  1. Take a hard dependency on a logging framework. Thus forcing all consumers of your library to also take a dependency on your choice of logging framework. This causes issues when they want to use a different framework or are using a different version of the same one.
  2. Use Common.Logging. Providing an abstraction over all the other frameworks has merit but it will add a reference to your consumers' projects. It's still a versionable dependency and can be prone to versioning clashes with other libraries. Common.Logging's ILog contains ~65 members whereas LibLog's ILog has just single method making it easier to implement custom loggers.
  3. Define your own Logging abstraction. A common approach used by many libraries that don't want to do 1 or 2. LibLog is designed to help those that would otherwise go down this path.

Then, why not use LibLog?

LibLog concept is very similar to this lib's. However:

  • LibLog is not mainained anymore, The author's rationale is that from now on, library authors will probably use logging abstractions provided by Microsoft. Well, I'm not so sure about that happening soon, and in the meantime I need a solution.
  • When I started implementing AnyLog I wasn't aware of the existence of LibLog and I did not feel like throwing my code away and take over LibLog maintenance. However it's stuffed with great ideas and I will happily cherry pick any stuff I find interesting in it and adapt it to AnyLog (starting with the Nuget packaging).
  • LibLog supports several logging framework (and advanced features such as semantic logging or nested contexts), but not Common.Logging. For our internal use, supporting Common.Logging is mandatory (because we'll need time to completely get rid of it). And because our current logging framework of choice is NLog we also do support it.
  • I already mentioned we needed to support Common.Logging, therefore I also modeled the logging API after Common.Logging's. It is probably not the best one, but it eases our migration path.

Maybe some/all of the great features in LibLog will make it into this library. But only time will say. And it is definitely not a requirement to be API-compatible with LibLog.

History

0.2.1 - 2021/05/25

  • Added a missing ExcludeFromCodeCoverage attribute on top of LoggingFrameworkRegistry class

0.2.0 - 2020/09/29

0.1.0 - 2020/09/19

  • Initial version: supports NLog and Common.Logging

Credits

  • LibLog is the main source of inspiration of this library. A great thanks to the author for having cleared the path I'm now taking.

License

This work is provided under the terms of the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.1

  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 1,690 5/17/2022
1.1.0 500 3/12/2022
1.0.0 432 3/1/2022
0.2.1 565 5/25/2021
0.2.0 906 9/29/2020
0.1.0 418 9/20/2020