Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to disable debug logging for web builds #225

Open
willsmanley opened this issue Jan 6, 2025 · 4 comments
Open

Impossible to disable debug logging for web builds #225

willsmanley opened this issue Jan 6, 2025 · 4 comments

Comments

@willsmanley
Copy link

willsmanley commented Jan 6, 2025

I haven't looked to far into the library code to see what's going on, but even if I provide a logger with .OFF, I can't silence the debug logs (perhaps because they always go to console.log in JS which are picked up by dart debugger connection?).

something like this should work:

hierarchicalLoggingEnabled = true;
final logger = Logger('PowerSyncLogger')..level = Level.OFF;
db = PowerSyncDatabase(schema: schema, path: await getDatabasePath(), logger: logger);

it would be nice to be able to silence these so I can see my other web logs cleanly while powersync is running.

Thank you for the great sdk!

@willsmanley
Copy link
Author

I forked and disabled the autologger like this: https://github.com/willsmanley/powersync.dart/blob/main/packages/powersync_core/lib/src/log.dart

It would be nice to be able to disable this from the SDK level without forking

@stevensJourney
Copy link
Contributor

Hi @willsmanley .

From the changes made in your fork it looks like you've removed the kDebugMode check. Just for my clarification, would you like to disable the debug logs while in debug mode, or does it seem like for web the debug mode is always enabled?

@willsmanley
Copy link
Author

I'd like to run my app in debug mode but not have powersync logs emitted. So possibly that could be done with a configuration?

@stevensJourney
Copy link
Contributor

Thanks for the info. I think we should be able to improve this. We'll track this internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants