SharpLogger 1.0.5
dotnet add package SharpLogger --version 1.0.5
NuGet\Install-Package SharpLogger -Version 1.0.5
<PackageReference Include="SharpLogger" Version="1.0.5" />
paket add SharpLogger --version 1.0.5
#r "nuget: SharpLogger, 1.0.5"
// Install SharpLogger as a Cake Addin #addin nuget:?package=SharpLogger&version=1.0.5 // Install SharpLogger as a Cake Tool #tool nuget:?package=SharpLogger&version=1.0.5
SharpLogger
A custom logging system for .NET, written in C#, which allows levels and filtering, with an independent output implementation.
Getting Started
View the examples page for information on a various logger setups.
Overview
SharpLogger attempts to push you away from being stingy with what you log. I believe that it is valuable to log many things in your code, however, this often turns into a mess, when you have a cluttered log file with information regarding objects you are no longer interested in, or are not currently concerned with.
The solution is not to remove those logs, but rather filter them, to only show the information you are interested in. SharpLogger allows you to specify a log level for your logs, as well as a filter, which can be dot separated into groups and subgroups. This allows you to simply specify a filter you are interested in, and viewing the logs regarding that specific filter. Filters can be changed on the fly, while the application is running.
Printer
The logger calls the printer class' Print() method, allowing you to override the class with your own handler for the log itself, meaning you are not restricted to Console.WriteLine(), or Debug.Log() for Unity, but can take the processed string from the logger and do with it what you like, including writing to a file.
This also means you can use SharpLogger on slightly different environments, since you are able to control them individually, such as Unity Client and Server applications.
Contributing
If you'd like to contribute, feel free to fork the repository. Pull requests are welcome!
Diagrams
Component Diagram
Class Diagram
Dev Log
12 Jan 2018
There seems to be an issue with msbuild using the Net35 assemblies, so in order to package the NuGet package with dotnet, there is an override added to the csproj file.
The latest release 1.0.4 on NuGet or the latest release 1.0.4 on GitHub includes dlls for NetStandard 1.0, Net35 and Net4. If you are using Unity, use the Net35 dlls.
9 Jan 2018
Changed target runtime to NetStandard 1.0, since there is no need to restrict the library to NetCore. I am working on including a library built for Net3.5 also, since Unity does not seem to work with NetStandard libraries, and Unity is certainly required to be compatible.
Opened a question here on Unity.com/questions, to see if I can get some answers regarding the issue with Unity and NetStandard libraries.
For now the release and the NuGet package will include both NetStandard and Net3.5 dlls.
Thinking also of changing the filtering system somewhat, to ensure consistent wording is used. I have noticed an issue sometimes arrises where I sometimes set the filter to be "NetworkManager.Objects" and sometimes "NetworkManager.Object" as an example, without noticing the plural on one of them, and this then causing issues later in the filter. Possibly a sort of enum, or some form of filter tracking is needed.
Product | Versions 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 | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.0 is compatible. netstandard1.1 was computed. netstandard1.2 was computed. netstandard1.3 was computed. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Windows Phone | wp8 was computed. wp81 was computed. wpa81 was computed. |
Windows Store | netcore was computed. netcore45 was computed. netcore451 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
This package has 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.
Now targets NetStandard1.0, Net35 and Net4. Fixed issue where previous release missed the lib.