log
Simple kotlin library for logging android and desktop projects
repositories {
maven {
url = uri("https://repo.repsy.io/mvn/mallumo/public")
}
}
dependencies {
implementation "tk.mallumo:log:$version_log"
}
GLOBAL Enable / Disable by static variable:
tk.mallumo.log.LOGGER_IS_ENABLED
Enable / Disable by static variable:
if is library used in android project BUT in junit test, this prevent writing output to android logger output
tk.mallumo.log.LOGGER_CONSOLE_FORCE
Usage 1
tk.mallumo.log.logDEBUG("123")
// android-> in console will be output ([Name-Of-Class].kt:[Souce-Code-Line-Nuber]) [name-of-method]--> [input]
// desktop-> in console will be output (DEBUG: [Name-Of-Class].kt:[Souce-Code-Line-Nuber]) [name-of-method]--> [input]
//in console android:
// (LoggerTest.kt:20) testFun--> 123
//in console desktop:
//DEBUG: (LoggerTest.kt:20) testFun--> 123
Usage 2
data class Input(var itemx: String = "x")
tk.mallumo.log.logWARN(input = Input(), prettyPrin = false)
//in console:
// (LoggerTest.kt:20) testFun--> {"itemx":"x"}