diff --git a/packages/suite-desktop-core/src/modules/bridge.ts b/packages/suite-desktop-core/src/modules/bridge.ts index 1974867d3a83..d61e7201260a 100644 --- a/packages/suite-desktop-core/src/modules/bridge.ts +++ b/packages/suite-desktop-core/src/modules/bridge.ts @@ -6,6 +6,7 @@ import { TrezordNode } from '@trezor/transport-bridge'; import { app, ipcMain } from '../typed-electron'; import { BridgeProcess } from '../libs/processes/BridgeProcess'; import { b2t } from '../libs/utils'; +import { Logger } from '../libs/logger'; import type { Module, Dependencies } from './index'; @@ -53,6 +54,11 @@ const getBridgeInstance = (store: Dependencies['store']) => { return new BridgeProcess(); } + const localLogger = new Logger('info', { + writeToDisk: true, + outputFile: 'trezor-bridge.log', + outputPath: app.getPath('userData'), + }); return new TrezordNode({ port: 21325, api: bridgeDev || bridgeTest ? 'udp' : 'usb', @@ -60,12 +66,12 @@ const getBridgeInstance = (store: Dependencies['store']) => { // passing down ILogger where Log is expected. // @ts-expect-error logger: { - ...global.logger, - log: (...args) => logger.info('trezord-node', args.join(' ')), - info: (...args) => logger.info('trezord-node', args.join(' ')), - warn: (...args) => logger.warn('trezord-node', args.join(' ')), - debug: (...args) => logger.debug('trezord-node', args.join(' ')), - error: (...args) => logger.error('trezord-node', args.join(' ')), + ...localLogger, + log: (...args) => localLogger.info('trezord-node', args.join(' ')), + info: (...args) => localLogger.info('trezord-node', args.join(' ')), + warn: (...args) => localLogger.warn('trezord-node', args.join(' ')), + debug: (...args) => localLogger.debug('trezord-node', args.join(' ')), + error: (...args) => localLogger.error('trezord-node', args.join(' ')), }, }); };