LogViewWPF 1.0.0.3
dotnet add package LogViewWPF --version 1.0.0.3
NuGet\Install-Package LogViewWPF -Version 1.0.0.3
<PackageReference Include="LogViewWPF" Version="1.0.0.3" />
<PackageVersion Include="LogViewWPF" Version="1.0.0.3" />
<PackageReference Include="LogViewWPF" />
paket add LogViewWPF --version 1.0.0.3
#r "nuget: LogViewWPF, 1.0.0.3"
#:package LogViewWPF@1.0.0.3
#addin nuget:?package=LogViewWPF&version=1.0.0.3
#tool nuget:?package=LogViewWPF&version=1.0.0.3
LogViewWPF [日志显示页]
Can be used to display live logs, comes with a simple search function.
可以用于显示实时日志,附带简单的搜索功能。
Usage
Xaml
xmlns:logview="clr-namespace:LogViewWPF;assembly=LogViewWPF"
<logview:LogViewControl x:Name="logViewControl"/>
You can set line caps and colours for various log types.
你可以设置行上限和各种日志类型的颜色。
<logview:LogViewControl x:Name="logViewControl" Grid.Row="1"
MaxLine="1000" EnableSearch="True" ShowType="True" Spacing="10,5"
TraceBrush="LightGray" DebugBrush="Gray" InformationBrush="Black" WarningBrush="DarkOrange"
ErrorBrush="Red" CriticalBrush="DarkRed" SearchMatchBrush="#DDF5FF" SearchCurrentBrush="#FFFAE1"/>
If EnableSearch = "True", Ctrl+F shows the search bar, Esc hides it.
如果EnableSearch = "True",Ctrl+F 显示搜索栏,Esc 隐藏搜索栏
C#
* Basic 基本
Add logging to the display.
添加日志到显示。
logViewControl.AppendLog("log defualt level is Information");
logViewControl.AppendLog("append debug", LogLevel.Debug);
logViewControl.AppendLog("error text", LogLevel.Error);
List<(string,LogLevel)> lines = new List<(string, LogLevel)>();
for (int i = 0; i < 5; i++)
lines.Add((GenerateRandomLog(), (LogLevel)(random.Next(0, 6))));
logViewControl.AppendMultiLog(lines);
//logViewControl.ClearLog();
LogLevel enumeration is consistent with Microsoft.Extensions.Logging.LogLevel, except that there is no "LogLevel.None".
日志等级枚举与 Microsoft.Extensions.Logging.LogLevel一致,除了没有"LogLevel.None"。
* Subscription 订阅
You can associate an Action with your own logging service.
你可以让你自己日志服务的 Action 与之关联。
public class LogHelper
{
public Action<string> OnLogAppend { get; set; }
public static void Log(string text)
{
//write to file
OnLogAppend?.Invoke(text);
}
}
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
LogHelper.OnLogAppend += OnLogAppend;
LogHelper.Log("test")
}
public void OnLogAppend(string text)
{
logViewControl.AppendLog(text);
}
}
* Filter 过滤类型
Filter Log Type Display.
过滤日志类型显示。
logViewControl.TypeFilter = new List<LogLevel>() { LogLevel.Information, LogLevel.Error };
| Product | Versions 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. net6.0-windows7.0 is compatible. 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 | netcoreapp3.1 is compatible. |
| .NET Framework | net471 is compatible. net472 was computed. net48 was computed. net481 was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.7.1
- No dependencies.
-
net6.0-windows7.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.