Huanent.Logging.Core 1.1.0

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

// Install Huanent.Logging.Core as a Cake Tool
#tool nuget:?package=Huanent.Logging.Core&version=1.1.0                

Microsoft.Extensions.Logging extensions

Install

Nuget Nuget

Usage

Huanent.Logging.Core

public class ConsoleLogWriter : ILogWriter
{
    public void WriteLog(LogLevel level, string message, string name, Exception exception, EventId eventId)
    {
        Console.WriteLine($"From {nameof(ConsoleLogWriter)} {level} {message} {name} {exception} {eventId}");
    }
}

//ILoggingBuilder
logging.AddImplementation<ConsoleLogWriter>();

Huanent.Logging.File

//ILoggingBuilder
logging.AddFile();

Log will out in {application folder}/logs/20211020.txt

[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:35 +00:00]
Worker running at: 10/20/2021 21:05:35 +08:00
System.Exception: error

[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:36 +00:00]
Worker running at: 10/20/2021 21:05:36 +08:00
System.Exception: error

[Error] [LoggingFileSample.Worker] [0] [2021/10/20 01:05:37 +00:00]
Worker running at: 10/20/2021 21:05:37 +08:00
System.Exception: error
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Huanent.Logging.Core:

Package Downloads
Huanent.Logging.File

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 142 8/26/2024
1.0.1 2,492 11/27/2021
1.0.0 1,381 10/20/2021