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

Android default logging has changed in 4.0.0 #327

Closed
benkuly opened this issue Jun 30, 2023 · 2 comments
Closed

Android default logging has changed in 4.0.0 #327

benkuly opened this issue Jun 30, 2023 · 2 comments

Comments

@benkuly
Copy link

benkuly commented Jun 30, 2023

In kotiln-logging versions before 4.0.0 on Android slf4j was used for logging. This has been switched to android.util.Log.

Regarding to the android documentation, java.util.logging is used for "non-system application". As far as I know SLF4J does use it internally.

Maybe I missed something, but with android.util.Log there seems to be no reasonable configuration options for logging, which makes it unusable for us.

oshai added a commit that referenced this issue Jun 30, 2023
pull up slf4j dependency to java shared module.
Add a system property to allow native android logging:
`kotlin-logging-to-android-native`

Issue #327
oshai added a commit that referenced this issue Jun 30, 2023
* change android to depend on slf4j2 by default

pull up slf4j dependency to java shared module.
Add a system property to allow native android logging:
`kotlin-logging-to-android-native`


* pull up KLogger
* add slf4j compile dependency.
* add slf4j test dependency.
* implement more methods.

Issue #327
@oshai
Copy link
Owner

oshai commented Jun 30, 2023

Releasing now 4.0.2 with a fix

@oshai
Copy link
Owner

oshai commented Jun 30, 2023

To the best of my knowledge the default in android is android.util.Log.
You can see popular frameworks like https://github.com/JakeWharton/timber that enhance it.
I think that traditionally (unlike servers) mobile devices want to keep away from debug logging for storage and performance reasons.

At the moment we will keep slf4j as the default, but I am still checking and in case it will be requested we might change the default in the future to native android logging. To use native logging set -Dkotlin-logging-to-android-native=true

@oshai oshai closed this as completed Jul 11, 2023
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