Lin.LogHelper 0.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Lin.LogHelper --version 0.0.1                
NuGet\Install-Package Lin.LogHelper -Version 0.0.1                
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="Lin.LogHelper" Version="0.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Lin.LogHelper --version 0.0.1                
#r "nuget: Lin.LogHelper, 0.0.1"                
#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 Lin.LogHelper as a Cake Addin
#addin nuget:?package=Lin.LogHelper&version=0.0.1

// Install Lin.LogHelper as a Cake Tool
#tool nuget:?package=Lin.LogHelper&version=0.0.1                

Lin.LogHelper

简介

一个简易的日志辅助类,不用任何配置,直接可用.日志保存到程序运行目录. 适用于工程已经开发到一半急需添加日志功能的情况下快速安装使用.

本库将Log分为4类: 以下按照 紧急程度低紧急程度高 排序

Type Description Method
Info 消息,通常输出运维人员可直接读懂的文本信息. LogForInfomation
Debug 调试信息,用于输出变量值等调试用的数据. LogForDebug
Warning 警告,程序运行过程中,遇到小异常,不影响程序运行.对该类情况进行记录. LogForWarning
Error 程序错误,无法继续执行. LogForError

使用方法

nuget安装这个包之后,在需要使用扩展方法的文件里,引用如下命名空间:

using Lin.LogHelper;

文本日志

int a=10,b=5;
$"这是一个日志!".LogForInfomation();
$"a:{a} b:{b}".LogForDebug();
$"内存即将用完!CPU高温!".LogForWarning();
$"数据错误,程序无法继续执行!".LogForError();

Byte[] 记入日志

有时候我们需要把一大块数据记录到log 这个库也可以记录Byte[],使用方法和文本差不多. 四个类都支持,但建议把Byte[]记录为Debug类.

var buff=new byte[]{0x00,0x12,0xAB};
buff.LogForDebug();

Exception 记入日志

使用方法如上.只支持Error类

try
{
    string str = null;
    var len = str.Length;
}
catch (Exception err)
{
    err.LogForError();
}
Product 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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 is compatible.  net451 is compatible.  net452 is compatible.  net46 is compatible.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  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.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.5.1

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.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
0.0.5 539 5/11/2022
0.0.4 438 5/11/2022
0.0.3 1,048 5/13/2020
0.0.1 441 4/23/2020