mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-08 18:33:39 +00:00
feat(logging): default to paused state and prevent performance hit via frontend wrapper
- Default LOG_PAUSED to true in backend. - Combine tauri_plugin_log filters to drop backend logs when paused. - Create frontend logger wrapper to intercept and drop logs before IPC when paused. - Sync LogsView state directly with logger wrapper and handle initialization races.
This commit is contained in:
@@ -8,8 +8,9 @@ vi.mock('../ipc', () => ({
|
||||
}));
|
||||
|
||||
// Mock window.__TAURI_INTERNALS__ and log to prevent errors
|
||||
vi.mock('@tauri-apps/plugin-log', () => ({
|
||||
vi.mock('../utils/logger', () => ({
|
||||
info: vi.fn(),
|
||||
warn: vi.fn(),
|
||||
error: vi.fn(),
|
||||
}));
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { create } from 'zustand';
|
||||
import { info } from '@tauri-apps/plugin-log';
|
||||
import { info } from '../utils/logger';
|
||||
import { invokeCommand as invoke } from '../ipc';
|
||||
|
||||
import type { DownloadItem } from '../bindings/DownloadItem';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist, createJSONStorage, StateStorage } from 'zustand/middleware';
|
||||
import { invokeCommand as invoke } from '../ipc';
|
||||
import { info } from '@tauri-apps/plugin-log';
|
||||
import { info } from '../utils/logger';
|
||||
import type { ActiveView } from '../bindings/ActiveView';
|
||||
import type { AppFontSize } from '../bindings/AppFontSize';
|
||||
import type { ListRowDensity } from '../bindings/ListRowDensity';
|
||||
|
||||
Reference in New Issue
Block a user