powersync-js icon indicating copy to clipboard operation
powersync-js copied to clipboard

[bug] Logger is always enabled on Firefox

Open LucDeCaf opened this issue 10 months ago • 2 comments

I use Zen Browser, which is based on Firefox. From what I've seen, the js-logger used by Powersync is always logging with no way to disable it when using Firefox.

Logs appear in the console (mostly from BroadcastLogger.js) regardless of whether or not my project depends on js-logger directly. If I set up js-logger according to the docs, the logs appear twice. The only difference between logs sent by Powersync's in-built logger and my project's logger is that my project's logs have a namespace prefix, usually being [PowerSyncStream].

Setting Logger.setLevel(Logger.OFF) only disables the global logger, not Powersync's. This means that logs can't be turned off on Firefox.

I tested all the above scenarios on Chrome and there were no issues - logs only appeared when I set the logger up manually. My guess is that Firefox is uncommon enough (and buggy enough) that this slipped under the radar.

LucDeCaf avatar Apr 02 '25 13:04 LucDeCaf

Hey @LucDeCaf we're investigating this one.

michaelbarnes avatar Apr 04 '25 22:04 michaelbarnes

Hey @LucDeCaf, FYI the js-logger dependency and it's vite specific configuration should no longer needed in the latest versions of common, web, and react-native. We have also done a bit of work to make sure that workers respect applied log levels, which was likely the issue here. Let me know if this resolves the issue for you!

Chriztiaan avatar Apr 24 '25 11:04 Chriztiaan