Dreamine.Logging 1.0.2
Dreamine.Logging 프로젝트의 API와 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
DreamineLogEntry.cs
이 파일의 문서화 페이지로 가기
1using System;
2
4
13public sealed class DreamineLogEntry
14{
23 public DateTimeOffset Timestamp { get; }
24
33 public DreamineLogLevel Level { get; }
34
43 public string Category { get; }
44
53 public string Message { get; }
54
63 public Exception? Exception { get; }
64
73 public int ThreadId { get; }
74
83 public string TimestampText => Timestamp.ToString("yyyy-MM-dd HH:mm:ss.fff");
84
93 public string DisplayText
94 {
95 get
96 {
97 var text = $"[{TimestampText}] [{Level}] [{Category}] [T{ThreadId}] {Message}";
98
99 if (Exception is null)
100 {
101 return text;
102 }
103
104 return text + Environment.NewLine + Exception;
105 }
106 }
107
165 DateTimeOffset timestamp,
166 DreamineLogLevel level,
167 string category,
168 string message,
169 Exception? exception,
170 int threadId)
171 {
172 Timestamp = timestamp;
173 Level = level;
174 Category = string.IsNullOrWhiteSpace(category) ? "Dreamine" : category;
175 Message = message ?? string.Empty;
176 Exception = exception;
177 ThreadId = threadId;
178 }
179}
DreamineLogEntry(DateTimeOffset timestamp, DreamineLogLevel level, string category, string message, Exception? exception, int threadId)