using System; namespace XP.Hardware.PLC.Sentry.Models { /// /// Sentry 操作日志级别枚举 | Sentry operation log level enumeration /// public enum SentryLogLevel { /// /// 信息 | Information /// Info, /// /// 警告 | Warning /// Warning, /// /// 错误 | Error /// Error } /// /// Sentry 操作日志条目模型 | Sentry operation log entry model /// public class SentryLogEntry { /// /// 时间戳 | Timestamp /// public DateTime Timestamp { get; set; } /// /// 格式化的时间戳显示(HH:mm:ss.fff)| Formatted timestamp display /// public string TimestampDisplay => Timestamp.ToString("HH:mm:ss.fff"); /// /// 日志消息 | Log message /// public string Message { get; set; } = string.Empty; /// /// 日志级别 | Log level /// public SentryLogLevel Level { get; set; } = SentryLogLevel.Info; /// /// 用于显示的格式化文本 | Formatted text for display /// public string DisplayText => $"[{TimestampDisplay}] [{Level}] {Message}"; } }