将Feature/XP.Common和Feature/XP.Hardware分支合并至Develop/XP.forHardwareAndCommon,完善XPapp注册和相关硬件类库通用类库功能。
This commit is contained in:
@@ -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}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user