feat(diagnostics): add health engine
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { DiagnosticEntry } from '../models/diagnostics.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DiagnosticsLoggerService {
|
||||
private readonly logsState = signal<DiagnosticEntry[]>([]);
|
||||
|
||||
readonly logs = this.logsState.asReadonly();
|
||||
|
||||
log(entry: DiagnosticEntry): void {
|
||||
this.logsState.update(current => [entry, ...current].slice(0, 300));
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.logsState.set([]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user