Yoko.Log 1.3.2

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

// Install Yoko.Log as a Cake Tool
#tool nuget:?package=Yoko.Log&version=1.3.2                

Yoko.Log

​ 市面上优秀的高性能日志组件太多了,但大多配置略微繁琐,你懂的。本着懒人至上的原则,撸一个精简的日志组件,开箱即用~

🔹 目前只支持 Net5、Net6 +

🔹 暂不支持WinForm

日志默认按天存储,如 yyyy_MM_dd.log

日志默认存储目录为工程项目下的根目录Log中

支持配置单个文件存储上限

日志使用内置微队列实现,不影响工程项目性能

更多个性化配置请看Log.config

✨ 文本日志

默认提供两个常用的输出方法

using Yoko.Log;

// 普通日志输出,日志等级:Info
YokoLog.WriteLine("日志输出");

//异常日志输出,日志等级:Error
YokoLog.WriteException();

还不满足的话,可以独立控制输出等级

// 日志现实 Info/Debug/Warn/Error/Fatal 标准接口
YokoLog.Log.Info("日志输出");

如果某个模块需要单独存储日志

//实例化一个模块专用的NewFileLog对象
var Log = NewFileLog.Create(@"日志存储目录");
Log.Info("日志输出");

✨ 日志内容

#Software: TestLog
#CLR: 5.0.17, .NET 5.0.17
#OS: , Yoko-Pc/Administrator
#Date: 2022-06-14
#Fields: Time ThreadID Message
14:36:53.182 [7] System.ApplicationException: 我抛出了一个异常
14:36:53.200 [7] 测试日志输出
  • 固定日志头

  • 默认字段:时间、线程ID、日志内容

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.
  • net6.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.2 241 6/14/2022