-
-
Notifications
You must be signed in to change notification settings - Fork 122
KotlinLoggingConfiguration
is not accessible on nativeMain
#494
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
Comments
Thank you for reporting an issue. See the wiki for documentation and slack for questions. |
KotlinLoggingConfiguration
is not accessible on nativeMain
Hi, |
Apologies for any confusion. My application doesn't utilize a commonMain source set; it only contains nativeMain and nativeTest. I was referring to your source code.
How could we implement that dependency change within our application project? The challenge we face is that the necessary logging configuration isn't accessible from nativeMain. To configure logging, we currently have to explicitly define platform-specific source sets, which is a cumbersome and verbose process. |
@oshai sorry for the ping..anything can be done from the library side to access the LoggingConfig from nativeMain ? |
I think that the option from lib side is to promote From your side you can create a module for each target and there it should be possible to depend on it. For example ios x64 should have that class. |
Thanks! yeah, I think that's the best solution. I would like to avoid creating modules for individual targets as most of my code is on nativeMain. |
I tried doing it, but it's a bit more tricky. Darwin already have a different impl: https://github.com/oshai/kotlin-logging/blob/master/src/darwinMain/kotlin/io/github/oshai/kotlinlogging/KotlinLoggingConfiguration.kt The lib "native" is actually just linux targets. What are the targets you're supporting? |
Mainly all desktop native targets ( |
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.
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?
The text was updated successfully, but these errors were encountered: