prose-im / prose-app-web

Prose Web application. XMPP client for team messaging.
https://prose.org/downloads
Mozilla Public License 2.0
19 stars 2 forks source link

Add logging support to Tauri app #92

Closed nesium closed 2 months ago

nesium commented 2 months ago

Hey @valeriansaliou.

I have changed logging in the core so that it now calls a class that implements ProseLogger instead of writing directly to the console.

Could you change the logger in utilities/logger.ts so that it logs either to the browser console when running in the browser or otherwise uses the Tauri logging methods (see broker/logger.ts) when running in Tauri?

The enabled flag would also need to be changed in utilities/logger.ts when running in Tauri.

Anyways, when you now run the app logs are written to ~/Library/Logs/org.prose.app-web/Prose.log, so that should simplify things a bit in production.

valeriansaliou commented 2 months ago

Thanks Marc, I've added forwarding of the frontend/JS logger output to the Tauri backend as you've requested. The logs will not be printed in the browser console for Tauri builds.

Also, made some improvements so that we don't output TRACE logs coming from Tauri internals in eg. production builds.