Skip to content

Fix some logging issues #242

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Radiokot
Copy link
Contributor

@Radiokot Radiokot commented Aug 7, 2025

Hey guys,

This pull request addresses some logging issues I spotted long ago, but today I wanted to have certain PowerSync logs in my common app log, and this was time to fix them.

  1. Fixed modifying severity of the global Kermit logger – it is up to the app owner to decide on this parameter. The library no longer uses the global instance by default;
  2. Added PowerSync tag to the logs – as now the library has its own default logger instance, it deserves a tag;
  3. Removed generateLogger() global public method – it really seemed like a method meant to be used internally as it is quite specific, but even internally it is no longer needed.

I didn't run any tests because I couldn't wait for the project to build. On my Intel Core Ultra 7 14x4.8 GHz with 32 GB of RAM the build didn't finish in 45 minutes, it's already late here and I should go to bed soon.

@Radiokot
Copy link
Contributor Author

Radiokot commented Aug 7, 2025

Ok, seems that I shouldn't try to beat this lint without support from IDEA, but it doesn't work until the project is built, which it doesn't.

Copy link
Contributor

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with these changes, and looking at an example app it's nice that we now have a proper tag for PowerSync-related logs 👍

I didn't run any tests because I couldn't wait for the project to build. On my Intel Core Ultra 7 14x4.8 GHz with 32 GB of RAM the build didn't finish in 45 minutes, it's already late here and I should go to bed soon.

That's probably an issue with our build setup and not with your machine. Do you remember a specific task taking too long (or was it just stuck downloading dependencies)? We build or SDK on GH actions which is a lot slower but still seems to work. So I assume there may be something locking up here.

@Radiokot
Copy link
Contributor Author

Do you remember a specific task taking too long (or was it just stuck downloading dependencies)?

It was just the initial Gradle sync, if I remember correctly it is called "Build model". It was not stuck, it just kept downloading and building, and so on and so on.

* Generates a logger with the appropriate severity level based on the build type
* if no Logger is provided.
*/
public fun generateLogger(logger: Logger?): Logger {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently being used by the Swift SDK (which wraps this module). We can still remove it from this module, but we'd need to move it to the PowerSyncKotlin module in order for the Swift SDK to continue using it.

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

Successfully merging this pull request may close these issues.

3 participants