LighterLog 1.3.0

dotnet add package LighterLog --version 1.3.0                
NuGet\Install-Package LighterLog -Version 1.3.0                
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="LighterLog" Version="1.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LighterLog --version 1.3.0                
#r "nuget: LighterLog, 1.3.0"                
#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 LighterLog as a Cake Addin
#addin nuget:?package=LighterLog&version=1.3.0

// Install LighterLog as a Cake Tool
#tool nuget:?package=LighterLog&version=1.3.0                

LightLog

A lightweight logger created with dependency injection in mind. It is done for the most part.

Loggers

There are different kinds of loggers that come with this library. Here they are and what they do:

  1. The basic logger Logger: This logger has the most flexibility as it is single-threaded. The AsyncLogger was recently merged with this Logger type so both synchronous and asynchronous methods are available depending on the required use case. An available option with this logger is the provided pre and post log events so users of the library can have their own things happen right before and right after a log happens. This type also comes with a static Shared property for a quick-start to logging with a single instance. This property can be reassigned.
  2. The toggle logger ToggleLogger: Backed by any kind of other ILogger, comes with an internal boolean state that determines whether or not a log will happen. Has a backing ILogger that all methods are delegated to. To get this, use the "UseForDebugging" extension method available to all ILogger implementations. This one can be good for debugging. One example of using this logger for debugging is using the DEBUG preprocessor flag to enable logging, otherwise leave disabled. The only loss in performance at that point is a boolean check that is guaranteed to be false. If the boolean is guaranteed to be false, so is the return type. That means the JIT will most likely optimize it so it doesn't affect anything.
  3. The global logger found statically as Shared in the Logger class is a partial extension to make a single logger widely accessible for quick starting. This is lazy and will only be initialized on the first retrieval. This comes with all capabilities of Logger.

Planned additions

  • A thread-independent logger that logs in its own separate thread using a blocking collection, concurrent queue and cancellation tokens.

NuGet

The package can be found on NuGet here

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.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.3.0 170 5/21/2023
1.2.1 142 5/18/2023
1.2.0 125 5/18/2023
1.1.0 139 5/2/2023
1.0.0 237 2/25/2023
0.9.1 250 2/16/2023
0.9.0 248 2/14/2023