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

Logging not appearing in LogCat KMM Compose #471

Open
ErickSorto opened this issue Jan 17, 2025 · 3 comments
Open

Logging not appearing in LogCat KMM Compose #471

ErickSorto opened this issue Jan 17, 2025 · 3 comments

Comments

@ErickSorto
Copy link

Hello I integrated kotlin-logging into my project but when I use the logger in my classes nothing appear in LogCat.

Code in common:

val logger = KotlinLogging.logger {}

@Composable
@Preview
fun App(
    onSplashFinished: () -> Unit = {}
) {
    logger.debug { "Testing!" }
    AppTheme {
            Surface(
                modifier = Modifier.fillMaxSize(),
                color = Color.Transparent
            ) {
                val navController = rememberNavController()
                //  val screen by splashViewModel.state
                MainGraph(
                    navController = navController,
                    onDataLoaded = onSplashFinished
                )
            }
    }
}

Nothing appears in LogCat. I added this to common dependencies in my KMM Compose project:

kotlinLogging = "7.0.3"

kotlin-logging = { module = "io.github.oshai:kotlin-logging", version.ref = "kotlinLogging" }

Copy link

Thank you for reporting an issue. See the wiki for documentation and slack for questions.

@zerofancy
Copy link

Maybe you need to place a simplelogger.properties in your resources directory if you are using org.slf4j:slf4j-simple. See here: How to configure slf4j-simple

@ErickSorto
Copy link
Author

Would this be in Shared Resource or Android Resource?

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