Dreamine.Logging 1.0.2
Dreamine.Logging 프로젝트의 API와 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.Logging.Services.InMemoryLogStore 클래스 참조sealed

더 자세히 ...

Dreamine.Logging.Services.InMemoryLogStore에 대한 상속 다이어그램 :
Dreamine.Logging.Services.InMemoryLogStore에 대한 협력 다이어그램:

Public 멤버 함수

 InMemoryLogStore ()
 InMemoryLogStore (int capacity)
IReadOnlyList< DreamineLogEntryGetEntries ()
void Add (DreamineLogEntry entry)
void Clear ()
void Write (DreamineLogEntry entry)

이벤트

EventHandler< DreamineLogEntry >? LogAdded
Dreamine.Logging.Interfaces.IDreamineLogStore(으)로부터 상속된 이벤트
EventHandler< DreamineLogEntry >? LogAdded

Private 속성

readonly object _syncRoot = new()
readonly Queue< DreamineLogEntry_entries
readonly int _capacity

상세한 설명

제한된 링 버퍼를 사용해 Dreamine 로그 항목을 메모리에 저장합니다.

Queue<T>를 사용해 삽입당 O(1)로 용량을 제한하며 스레드로부터 안전합니다.

InMemoryLogStore.cs 파일의 25 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ InMemoryLogStore() [1/2]

Dreamine.Logging.Services.InMemoryLogStore.InMemoryLogStore ( )
inline

기본 용량 1000으로 InMemoryLogStore를 초기화합니다.

InMemoryLogStore.cs 파일의 73 번째 라인에서 정의되었습니다.

74 : this(1000)
75 {
76 }

◆ InMemoryLogStore() [2/2]

Dreamine.Logging.Services.InMemoryLogStore.InMemoryLogStore ( int capacity)
inline

지정한 용량으로 T:Dreamine.Logging.Services.InMemoryLogStore를 초기화합니다.

매개변수
capacity유지할 최대 항목 수이며 0 이하면 1000을 사용합니다.

InMemoryLogStore.cs 파일의 94 번째 라인에서 정의되었습니다.

95 {
96 _capacity = capacity <= 0 ? 1000 : capacity;
97 _entries = new Queue<DreamineLogEntry>(_capacity);
98 }

다음을 참조함 : _capacity, _entries.

멤버 함수 문서화

◆ Add()

void Dreamine.Logging.Services.InMemoryLogStore.Add ( DreamineLogEntry entry)
inline

로그 항목을 추가하고 용량을 초과한 가장 오래된 항목을 제거합니다.

매개변수
entry추가할 항목입니다.
예외
ArgumentNullExceptionentrynull인 경우 발생합니다.

Dreamine.Logging.Interfaces.IDreamineLogStore를 구현.

InMemoryLogStore.cs 파일의 148 번째 라인에서 정의되었습니다.

149 {
150 ArgumentNullException.ThrowIfNull(entry);
151
152 lock (_syncRoot)
153 {
154 _entries.Enqueue(entry);
155
156 while (_entries.Count > _capacity)
157 {
158 _entries.Dequeue();
159 }
160 }
161
162 // Fire outside the lock to avoid reentrancy/deadlock if a handler
163 // calls back into the store.
164 LogAdded?.Invoke(this, entry);
165 }

다음을 참조함 : _capacity, _entries, _syncRoot, LogAdded.

다음에 의해서 참조됨 : Write().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Clear()

void Dreamine.Logging.Services.InMemoryLogStore.Clear ( )
inline

저장된 모든 로그 항목을 지웁니다.

Dreamine.Logging.Interfaces.IDreamineLogStore를 구현.

InMemoryLogStore.cs 파일의 175 번째 라인에서 정의되었습니다.

176 {
177 lock (_syncRoot)
178 {
179 _entries.Clear();
180 }
181 }

다음을 참조함 : _entries, _syncRoot.

◆ GetEntries()

IReadOnlyList< DreamineLogEntry > Dreamine.Logging.Services.InMemoryLogStore.GetEntries ( )
inline

저장된 로그 항목의 스냅샷을 가져옵니다.

반환값
저장 순서의 로그 항목 목록입니다.

Dreamine.Logging.Interfaces.IDreamineLogStore를 구현.

InMemoryLogStore.cs 파일의 116 번째 라인에서 정의되었습니다.

117 {
118 lock (_syncRoot)
119 {
120 return _entries.ToArray();
121 }
122 }

다음을 참조함 : _entries, _syncRoot.

◆ Write()

void Dreamine.Logging.Services.InMemoryLogStore.Write ( DreamineLogEntry entry)
inline

로그 출력 계약을 통해 항목을 저장소에 추가합니다.

매개변수
entry기록할 항목입니다.
예외
ArgumentNullExceptionentrynull인 경우 발생합니다.

Dreamine.Logging.Interfaces.IDreamineLogSink를 구현.

InMemoryLogStore.cs 파일의 207 번째 라인에서 정의되었습니다.

208 {
209 Add(entry);
210 }

다음을 참조함 : Add().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _capacity

readonly int Dreamine.Logging.Services.InMemoryLogStore._capacity
private

capacity 값을 보관합니다.

InMemoryLogStore.cs 파일의 53 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Add(), InMemoryLogStore().

◆ _entries

readonly Queue<DreamineLogEntry> Dreamine.Logging.Services.InMemoryLogStore._entries
private

entries 값을 보관합니다.

InMemoryLogStore.cs 파일의 44 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Add(), Clear(), GetEntries(), InMemoryLogStore().

◆ _syncRoot

readonly object Dreamine.Logging.Services.InMemoryLogStore._syncRoot = new()
private

sync Root 값을 보관합니다.

InMemoryLogStore.cs 파일의 35 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Add(), Clear(), GetEntries().

이벤트 문서화

◆ LogAdded

EventHandler<DreamineLogEntry>? Dreamine.Logging.Services.InMemoryLogStore.LogAdded

로그 항목이 추가될 때 발생합니다.

InMemoryLogStore.cs 파일의 63 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Add().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: