log

General

Category
Free
Tag
Logging
License
Apache License, Version 2.0
Registered
Sep 8, 2020
Favorites
1
Link
https://github.com/mallumoSK/log
See also
Console
log
FSLogger
LifecykleLog
Lumberjack

Additional

Language
Kotlin
Version
1.9.10-1.0.0 (Oct 26, 2023)
Created
Sep 5, 2020
Updated
Oct 26, 2023
Owner
mallumo (mallumoSK)
Contributor
mallumo (mallumoSK)
1
Activity
Badge
Generate
Download
Source code

Advertisement

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"}