44 lines
866 B
TypeScript
44 lines
866 B
TypeScript
export type LogLevel = 'info' | 'warn' | 'error';
|
|
|
|
export type LogEvent =
|
|
| 'APP_START'
|
|
| 'APP_STOP'
|
|
| 'VISIBILITY_CHANGE'
|
|
| 'NAVIGATE'
|
|
| 'SEARCH_EXECUTED'
|
|
| 'BOOKMARKS_OPEN'
|
|
| 'BOOKMARKS_MODIFY'
|
|
| 'GRAPH_VIEW_OPEN'
|
|
| 'GRAPH_VIEW_CLOSE'
|
|
| 'GRAPH_VIEW_SETTINGS_CHANGE'
|
|
| 'CALENDAR_SEARCH_EXECUTED'
|
|
| 'THEME_CHANGE';
|
|
|
|
export interface LogContext {
|
|
route?: string;
|
|
vault?: string;
|
|
theme?: 'light' | 'dark';
|
|
version?: string;
|
|
}
|
|
|
|
export interface LogRecord {
|
|
ts: string;
|
|
level: LogLevel;
|
|
app: 'ObsiViewer';
|
|
sessionId: string;
|
|
userAgent?: string;
|
|
context: LogContext;
|
|
event: LogEvent;
|
|
data?: Record<string, unknown>;
|
|
}
|
|
|
|
export interface LogConfig {
|
|
enabled: boolean;
|
|
endpoint: string;
|
|
batchSize: number;
|
|
debounceMs: number;
|
|
maxRetries: number;
|
|
circuitBreakerThreshold: number;
|
|
circuitBreakerResetMs: number;
|
|
}
|