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

Log4j 2.x #62

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions demo/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ kotlin {
}
commonMain.dependencies {
implementation(project(":log4k"))
implementation(project(":log4k-slf4j"))
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
Expand All @@ -56,6 +57,7 @@ kotlin {
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.slf4j.simple)
}
}
}
Expand All @@ -64,22 +66,13 @@ android {
namespace = "saschpe.log4k.demo"
compileSdk = libs.versions.android.compileSdk.get().toInt()

// sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
// sourceSets["main"].res.srcDirs("src/androidMain/res")
// sourceSets["main"].resources.srcDirs("src/commonMain/resources")

defaultConfig {
applicationId = "saschpe.log4k.demo"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = libs.versions.log4k.demo.get()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildTypes {
release {
isMinifyEnabled = false
Expand Down
8 changes: 4 additions & 4 deletions demo/compose/src/desktopMain/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import saschpe.log4k.FileLogger
import saschpe.log4k.FileLogger.Limit
import saschpe.log4k.FileLogger.Rotate
import saschpe.log4k.Log
import saschpe.log4k.slf4j.SLF4JLogger

fun main() = application {
Log.loggers += FileLogger(rotate = Rotate.Daily, limit = Limit.Files(max = 5))
Log.loggers.clear()
Log.loggers += SLF4JLogger()
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "debug")
Log.debug { "Desktop main" }

Window(
Expand Down
8 changes: 5 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ kotlin = "2.0.20"
ktlint = "1.3.1"
log4k-demo = "1.0.0"
mockk = "1.13.12"
slf4j = "2.0.16"

[libraries]
androidx-activity-compose = "androidx.activity:activity-compose:1.9.2"
kotlin-wrappers = "org.jetbrains.kotlin-wrappers:kotlin-node:22.5.4-pre.805"
kotlin-wrappers = "org.jetbrains.kotlin-wrappers:kotlin-node:22.5.4-pre.814"
kotlinx-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.6.1"
kotlinx-io = "org.jetbrains.kotlinx:kotlinx-io-core:0.5.3"
kotlinx-io = "org.jetbrains.kotlinx:kotlinx-io-core:0.5.4"
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" }
slf4j-api = "org.slf4j:slf4j-api:1.7.36"
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }

[plugins]
android-application = { id = "com.android.application", version.ref = "gradle-android" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
1 change: 1 addition & 0 deletions log4k-slf4j/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
kotlin {
androidTarget { publishAllLibraryVariants() }
iosArm64()
iosX64()
iosSimulatorArm64()
js { nodejs() }
jvm()
Expand Down
Loading