Skip to content

Use SLF4J API's in player module instead of Log4J #338

Merged
devgianlu merged 4 commits intolibrespot-org:devfrom
mitschwimmer:dev
Apr 13, 2021
Merged

Use SLF4J API's in player module instead of Log4J #338
devgianlu merged 4 commits intolibrespot-org:devfrom
mitschwimmer:dev

Conversation

@mitschwimmer
Copy link
Contributor

Originally I just asked for the lib-module to utilize SLF4J. But as the player module is now intended to be used on Android it should use Android-friendly logging as well.
The way it is done should allow to keep LOG4J as default. In case the runtime is Android one will need to force exclude LOG4J from the dependencies in gradle and add a SLF4J compatible wrapper for the Android Logging System.

Remarks

  1. Line 158 in DeviceStateHandler - Lambdas were used as parameters for the log call. This seems not supported with SLF4J therefore I referenced the paramters straight.
  2. Line 246 in DeviceStateHandler - I assumed you intended to log the first log message variant in case of level TRACE and translated to SLF4J API accordingly.
  3. I can't avoid merge commits with github it seems. I hope that is ok

@mitschwimmer
Copy link
Contributor Author

Hm, the build step "import of GPG secrets" fails. I assume this is a permission thing?

@devgianlu
Copy link
Member

Hm, the build step "import of GPG secrets" fails. I assume this is a permission thing?

Yep, now fixed.

Line 158 in DeviceStateHandler

That particular call is expensive, just added a check on the log level.

@devgianlu devgianlu merged commit 4702805 into librespot-org:dev Apr 13, 2021
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.

2 participants