jattac.libs.logger 1.0.0-beta05

This is a prerelease version of jattac.libs.logger.
There is a newer version of this package available.
See the version list below for details.
dotnet add package jattac.libs.logger --version 1.0.0-beta05
                    
NuGet\Install-Package jattac.libs.logger -Version 1.0.0-beta05
                    
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="jattac.libs.logger" Version="1.0.0-beta05" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="jattac.libs.logger" Version="1.0.0-beta05" />
                    
Directory.Packages.props
<PackageReference Include="jattac.libs.logger" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add jattac.libs.logger --version 1.0.0-beta05
                    
#r "nuget: jattac.libs.logger, 1.0.0-beta05"
                    
#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.
#:package jattac.libs.logger@1.0.0-beta05
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=jattac.libs.logger&version=1.0.0-beta05&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=jattac.libs.logger&version=1.0.0-beta05&prerelease
                    
Install as a Cake Tool

Jattac Logging Library

This basic yet extensible library build primarily to log exceptions.

Overview

It comes with two inbuilt log targets

  1. Console Logger Logs to the console.
  2. Disk Logger Logs to disk, and automatically deletes any files older than 30 days.

Usage

Simplest way to to create a global static instance program's startup. The constructor expects a HashSet of all the log targets that events shall be written.

public partial class Program
{
    public static ErrorLogger ErrorLogger = new ErrorLogger(new HashSet<IErrorLogTarget>
    {
        new ConsoleErrorTarget(),
        new DiskErrorLogTarget()
    });
}

After setup, you may now use the logger in your code. E.g.

public void MyMethod()
{
    try
    {
        // Error prone code
    }
    catch(Exception e)
    {
        ErrorLogger.Log(e, "Error occured when running the error prone section of the method");
    }
}

Extending The Library

If you wish to log to additional targets, then simply create a class that implements the interface

    public interface IErrorLogTarget
    {
        Task LogAsync(RichException richException);
    }

Which only requires single async method that receives a single argument with the exception information.

After creating your class then, you can include it in the log targets during instantiation of the ErrorLogger

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  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.

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.2.0-beta05 226 5/23/2025
1.2.0-beta04 214 5/23/2025
1.2.0-beta03 210 5/23/2025
1.2.0-beta02 232 5/23/2025
1.2.0-beta01 189 5/23/2025
1.1.0-beta06 242 4/9/2025
1.1.0-beta05 430 3/11/2024
1.1.0-beta04 490 2/1/2024
1.1.0-beta03 198 1/26/2024
1.1.0-beta02 196 1/25/2024
1.1.0-beta01 194 1/25/2024
1.0.1 282 4/9/2025
1.0.0 394 12/21/2023
1.0.0-beta05 246 8/30/2023
1.0.0-beta04 282 6/17/2023
1.0.0-beta03 273 6/11/2023
1.0.0-beta02 265 6/11/2023
1.0.0-beta01 273 6/10/2023