kotlin-logging icon indicating copy to clipboard operation
kotlin-logging copied to clipboard

`KotlinLoggingConfiguration` is not accessible on nativeMain

Open sureshg opened this issue 7 months ago • 8 comments

I'm developing a Kotlin Native CLI application where most of the code is in the nativeMain source set. This code depends on a shared module, which uses the io.github.oshai.kotlinlogging library in its commonMain source set.

I need to configure the logging specifically for the native target (e.g., add a FileAppender, change log levels). It seems the way to do this might be through KotlinLoggingConfiguration. However, I can't seem to access or configure this from my nativeMain code – KotlinLoggingConfiguration isn't resolving in the IDE within that context.

Image

Does it make sense to move this configuration class to commonMain instead of defining in the directMain intermediate sourceset Or is there a standard way to handle native-specific logger configuration within nativeMain itself?

sureshg avatar Apr 05 '25 22:04 sureshg