将Feature/XP.Common和Feature/XP.Hardware分支合并至Develop/XP.forHardwareAndCommon,完善XPapp注册和相关硬件类库通用类库功能。

This commit is contained in:
QI Mingxuan
2026-04-16 17:31:13 +08:00
parent 6ec4c3ddaa
commit 2bd6e566c3
581 changed files with 74600 additions and 222 deletions
@@ -0,0 +1,56 @@
using System;
namespace XP.Hardware.PLC.Sentry.Models
{
/// <summary>
/// Sentry 操作日志级别枚举 | Sentry operation log level enumeration
/// </summary>
public enum SentryLogLevel
{
/// <summary>
/// 信息 | Information
/// </summary>
Info,
/// <summary>
/// 警告 | Warning
/// </summary>
Warning,
/// <summary>
/// 错误 | Error
/// </summary>
Error
}
/// <summary>
/// Sentry 操作日志条目模型 | Sentry operation log entry model
/// </summary>
public class SentryLogEntry
{
/// <summary>
/// 时间戳 | Timestamp
/// </summary>
public DateTime Timestamp { get; set; }
/// <summary>
/// 格式化的时间戳显示(HH:mm:ss.fff| Formatted timestamp display
/// </summary>
public string TimestampDisplay => Timestamp.ToString("HH:mm:ss.fff");
/// <summary>
/// 日志消息 | Log message
/// </summary>
public string Message { get; set; } = string.Empty;
/// <summary>
/// 日志级别 | Log level
/// </summary>
public SentryLogLevel Level { get; set; } = SentryLogLevel.Info;
/// <summary>
/// 用于显示的格式化文本 | Formatted text for display
/// </summary>
public string DisplayText => $"[{TimestampDisplay}] [{Level}] {Message}";
}
}