FormatLog 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FormatLog --version 1.0.2
                    
NuGet\Install-Package FormatLog -Version 1.0.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="FormatLog" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FormatLog" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="FormatLog" />
                    
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 FormatLog --version 1.0.2
                    
#r "nuget: FormatLog, 1.0.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.
#:package FormatLog@1.0.2
                    
#: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=FormatLog&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=FormatLog&version=1.0.2
                    
Install as a Cake Tool

FormatLog ��־�������

�������

����������������Ŀ��

  • FormatLog�������ܽṹ����־�����֧�ֲ���������ʽȥ�ء����������ġ�����д�롢�α��ҳ��ѯ��
  • DemoWPF��WPF ��ʾ��Ŀ��չʾ��־д�롢��ѯ�����ı���Ⱦ�ȹ��ܡ�

FormatLog �������

��Ҫ����

  • �ṹ����־��ʽ��ͨ�� Format ΨһԼ������־���ݲ����������ڼ���������
  • **��������־**��Log ֧����� 10 ���������Զ��鵵������������ظ��洢��
  • ����������׷����CallerInfo ��¼��Ա���ļ����кţ����ڶ�λ��
  • ����������д����FLog ˫�������+��̨�̣߳��Զ�����д�� SQLite�������˳��Զ� Flush��
  • ��Ч��ҳ��ѯ��֧���α��ҳ��˫��ҳ������ɸѡ������ʱ�䡢��ʽ�������������ߵȣ���
  • �쳣�־û���Flush �쳣�Զ����� JSON/TXT�������Ų顣

����ṹ

  • FormatLog/Format.cs ��־��ʽ���壬Ψһ��Լ������������ SQL��
  • FormatLog/Log.cs ��־��ʵ�壬������ʽ�����������������ġ�����ʱ��ȡ�
  • FormatLog/Argument.cs ��־����ʵ�壬Ψһ��Լ����
  • FormatLog/CallerInfo.cs ����������ʵ�壬Ψһ��Լ����
  • FormatLog/LogDbContext.cs EF Core ���ݿ������ģ��Զ�����������ڷֿ⡣
  • FormatLog/FLog.cs ��־�ع��������д�롢�쳣�������ҳ��ѯ��
  • ���������ࣺQueryModel��FlushInfo��KeysetPage��

��������

  1. д����־
FLog.Add(new Log(LogLevel.Info, "�û���¼��{0}@{1}", userName, domain).WithCallerInfo());
  1. ��ѯ��־����ҳ��ɸѡ��
    var query = new QueryModel()
        .WithLevel(LogLevel.Info)
        .WithFormat("��¼")
        .OrderBy(OrderType.OrderByIdDescending)
        .WithCursorId(nextCursorId);

    var page = await query.KeysetPaginationAsync();

�������

  • ��ʽȥ������־��ʽ�����������������ľ��Զ�ȥ�أ���ʡ�洢�ռ䡣
  • ������Ч��˫�������+���� SQL ���룬��������д�����ܡ�
  • ����չ��֧���Զ���ɸѡ����ҳ���쳣�����
  • ���ݿ�ֿ�������ֿ⣬���ڹ鵵��ά����

����

  • �߲�����־д�������/�����Ӧ��
  • �ṹ����־����������ϵͳ
  • ��Ҫ׷�ٵ��������ġ������ĵ���/��ά����

����

  • .NET 8
  • Microsoft.EntityFrameworkCore.Sqlite

DemoWPF ��ʾ��Ŀ

��Ҫ����

  • ��־д����ʾ��֧�ֶ���������־��ϵͳ��Ϣ���˷�������������ַ�������/���ı���ʱ������û�/����/������Ϣ�ȣ�����д�롣
  • ��־��ѯ��ɸѡ��֧�ְ���ʽ�������������ߡ�����ʱ�䷶Χ�ȶ�����ɸѡ��֧���α��ҳ��˫��ҳ��
  • ���ı���Ⱦ����־���ݲ���������ʾ��֧�ֶַθ��ı���
  • ����ͳ����ʵʱ��ʾ��־д�����ܣ�ÿ����д���ʱ����

��Ҫ����

  • ��־д��ҳ��ѡ����־���ͺ͵ȼ�������д����ʾ��
  • ��־��ѯҳ��������ɸѡ����ҳ��������ı�������

���з�ʽ

  1. ��װ .NET 8 SDK��
  2. ���� DemoWPF ��Ŀ��WinExe��WPF����
  3. ���� MahApps.Metro��UI��������FormatLog����־���ģ���

���� FormatLog ����

  1. ���� FormatLog ��Ŀ�� NuGet ����
  2. ʹ�� FLog.Add(new Log(...).WithCallerInfo()) д����־��
  3. ʹ�� QueryModel ���з�ҳ��ѯ��
  4. WPF ���� LogViewModel ���и��ı��ֶ���Ⱦ��

Ŀ¼�ṹ

FormatLog/
  ���� Format.cs
  ���� Log.cs
  ���� Argument.cs
  ���� CallerInfo.cs
  ���� LogDbContext.cs
  ���� FLog.cs
DemoWPF/
  ���� LogViewModel.cs
  ���� LogTextSegment.cs
  ���� MainWindow.xaml(.cs)

����

  • .NET 8
  • Microsoft.EntityFrameworkCore.Sqlite
  • MahApps.Metro��DemoWPF UI��

��������

  • ��־д���쳣���Զ��־û��� JSON/TXT �ļ��������Ų顣
  • ��־���ݿⰴ��ֿ⣬���ڹ鵵��ά����

������ϸ API �ĵ�����ο������飬�����Դ��ע�ͻ���ϵά���ߡ�

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.  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. 
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 FormatLog:

Package Downloads
EFCoreLayerKit

基于 Entity Framework Core 的通用数据访问层工具包,支持自动仓储注册、DTO 映射、软删除、自动迁移等,适用于 .NET 8+ 项目。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.7 312 7/27/2025
1.0.6 330 7/26/2025
1.0.5 556 7/23/2025
1.0.4 550 7/22/2025
1.0.3 177 7/17/2025
1.0.2 164 7/17/2025
1.0.1 171 7/17/2025
1.0.0 173 7/16/2025