File tree Expand file tree Collapse file tree 5 files changed +34
-1
lines changed
kotlin/com/github/neboskreb/log4j2/examples/migration/lib
main/kotlin/com/github/neboskreb/log4j2/examples/migration/lib Expand file tree Collapse file tree 5 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,20 @@ android {
3636}
3737
3838dependencies {
39+ implementation ' io.github.neboskreb:android-log4j2-migration:2.0'
40+ implementation ' org.slf4j:slf4j-api:2.0.17'
41+ implementation ' org.slf4j:slf4j-ext:2.0.17'
3942 implementation ' androidx.core:core-ktx:1.17.0'
4043
4144
45+ testImplementation ' io.github.neboskreb:android-log4j2:2.24'
4246 testImplementation platform(' org.junit:junit-bom:5.12.2' )
4347 testImplementation ' org.junit.jupiter:junit-jupiter-api'
4448 testImplementation ' org.junit.jupiter:junit-jupiter'
4549 testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
4650
4751
52+ androidTestImplementation ' io.github.neboskreb:android-log4j2-junit5:2.24'
4853 androidTestImplementation platform(' org.junit:junit-bom:5.12.2' )
4954 androidTestImplementation ' org.junit.jupiter:junit-jupiter-api'
5055 androidTestImplementation ' org.junit.jupiter:junit-jupiter'
Original file line number Diff line number Diff line change 1+ # Root Logger
2+ rootLogger = OFF, LOGCAT
3+
4+ # Direct log messages to LOGCAT
5+ appender.logcat.type = Logcat
6+ appender.logcat.name = LOGCAT
7+ appender.logcat.layout.type = PatternLayout
8+ appender.logcat.layout.pattern = %m%n
9+ # appender.logcat.stack-trace-rendering = log4j
10+ appender.logcat.stack-trace-rendering = logcat
11+
12+
13+ logger.lib.name = MY_LIBRARY
14+ logger.lib.level = warn
Original file line number Diff line number Diff line change 11package com.github.neboskreb.log4j2.examples.migration.lib
22
33import org.junit.jupiter.api.Test
4+ import org.junit.jupiter.api.extension.ExtendWith
5+ import com.github.neboskreb.log4j2.android.AndroidLog4jExtension
46
7+ @ExtendWith(AndroidLog4jExtension ::class )
58class MyLibraryAndroidTest {
69 @Test
710 fun logSomething () {
Original file line number Diff line number Diff line change 11package com.github.neboskreb.log4j2.examples.migration.lib
22
3- import android.util .Log
3+ import com.github.neboskreb.log4j2.migration .Log
44
55private const val TAG = " MY_LIBRARY"
66
Original file line number Diff line number Diff line change 1+ # Root Logger
2+ rootLogger = OFF, CON
3+
4+ # Direct log messages to CON
5+ appender.console.type = Console
6+ appender.console.name = CON
7+ appender.console.layout.type = PatternLayout
8+ appender.console.layout.pattern = %-5p [%t]: %m%n
9+
10+ logger.lib.name = MY_LIBRARY
11+ logger.lib.level = off
You can’t perform that action at this time.
0 commit comments